initial commit
This commit is contained in:
32
node_modules/debug-fabulous/src/spawn.js
generated
vendored
Normal file
32
node_modules/debug-fabulous/src/spawn.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
function spawnFactory(_namespace, _debugFabFactory) {
|
||||
var namespace = _namespace || '';
|
||||
var debugFabFactory = _debugFabFactory;
|
||||
|
||||
if(!debugFabFactory){
|
||||
debugFabFactory = require('./debugFabFactory')();
|
||||
}
|
||||
|
||||
function spawn(ns) {
|
||||
// this is this.debug (from Debugger)
|
||||
var dbg = new Debugger(this.namespace, ns);
|
||||
|
||||
return dbg.debug;
|
||||
};
|
||||
|
||||
function Debugger(_base, _ns){
|
||||
var base = _base || '';
|
||||
var ns = _ns || '';
|
||||
|
||||
var newNs = ns ? [base, ns].join(':') : base;
|
||||
var debug = debugFabFactory(newNs);
|
||||
|
||||
this.debug = debug;
|
||||
this.debug.spawn = spawn;
|
||||
}
|
||||
|
||||
var rootDebug = (new Debugger(namespace)).debug;
|
||||
|
||||
return rootDebug;
|
||||
};
|
||||
|
||||
module.exports = spawnFactory;
|
||||
Reference in New Issue
Block a user