preacher
Install
npm install --save preacher
Goal
- To easily integrate visionmedia's debug into any javascript logging framework for node or the browser.
- Lazy log level evaluation
- Easy log namespace management via spawning.
API
preacher(options = {})
Options:
- ###
loggerToWrap
(required)- Logging instance that is wrapped. Typically this would be winston, console or $log (angular).
- ###
debugApi
(optional)- A visionmedia debug instance if one is not provided then one is created for you.
- ###
enable
(optional)- Comma delimmited string. If it is not defined it defaults to
debug's
ENV
variable ofDEBUG
.
- Comma delimmited string. If it is not defined it defaults to
- ###
levelFns
(optional)- Array of strings, typically
['info', 'warn', 'error']
. Levels to evaulate and possibly wrap.
- Array of strings, typically
- ###
doFileLine
(optional)- boolean defaults to
false
. Currently this is for node only to diplay the file and line number of the log output.
- boolean defaults to
- ###
decorLevels
(optional)- Array of strings, typically
['info', 'warn', 'error']
. Levels to add lazy evaluation and decorations (color-wrap, file info) to.
- Array of strings, typically
Basic Example:
const preacher = ; consoledebug = consolelog; // for example for node, no need in the browser const rootLogger = ; const demoLogger = ;const otherLogger = ;const hiddenLogger = ; const log1 = demoLogger;const log2 = demoLogger;const log3 = demoLogger;const log4 = otherLogger; const log5 = hiddenLogger; log1;log1;log1;;; // works but color is only for node;;;;