0.9.9-alpha2 • Published 4 years ago

debugrc v0.9.9-alpha2

Weekly downloads
4
License
GPLv3
Repository
github
Last release
4 years ago

debugrc (debug real challange)

The debugrc is a simple debuger for agent based model debug processor But can be usable for other purpose.

##init a manager

const debugManager =  new (require('debugrc')).debugBase();

##init a new agent

const debugSubOne = debugManager.newSub('worker one');

##add one log

debugSubOne.log(
    'worker one', // 
    'event something to debug', // debug text
    7 // debug log level (0-9) (optional)
);

##short hand link function.

// init a link 
const debug_two = debugManager.link('worker two');

// log somethineg

debug_two(
    'idd',
    7
);

##set console class

debugManager.setup.set('consoleOut', console.log);

##set default Log Level

debugManager.setup.set('defaultLevel',6);

##set current Log Level

debugManager.setup.set('currentLevel',6);

##add one log

debugManager.log(
    'worker one', // 
    'event something to debug', // debug text
    7 // debug log level (0-9) (optional)
);

##shoert hand link function.

// link to a ne
const debug_two = debugManager.link('worker two');


debug_two('first debug message');