Scribe.js/examples/run_with_config.js

36 lines
933 B
JavaScript
Raw Normal View History

2014-10-26 12:25:22 +01:00
/* jshint -W079 */
/**
* With config
*/
var scribe = require('../scribe')({
createDefaultConsole : false //Scribe won't attach a fresh console2 to process.console
});
console.log(process.console); //undefined
var myConfigConsole = scribe.console({
console : { //Default options for all myConfigConsole loggers
2014-10-26 16:52:08 +01:00
colors : 'white',
tagsColors : 'red',
timeColors : ['grey', 'underline'],
dateColors : ['gray', 'bgMagenta'],
fileColors : 'white',
lineColors : ['yellow', 'inverse']
2014-10-26 12:25:22 +01:00
}
});
2014-10-26 16:52:08 +01:00
myConfigConsole.addLogger('fun', ['rainbow', 'inverse', 'black']);
2014-10-26 12:25:22 +01:00
myConfigConsole.fun('Some rainbow in background !');
2014-10-26 16:52:08 +01:00
myConfigConsole.addLogger('log');
myConfigConsole.tag('A tag', 123).log('custom tags');
myConfigConsole.time().log('custom time');
myConfigConsole.date().log('custom date');
myConfigConsole.file().log('custom file');