simple-log= require '@partially-applied/simple-log'log= simple-log!# its possible to pass a config param to the constructor# log has only functionslog.generic 'Error: Test Error'log.stack!# logs the stack error
Options
colors= require 'colors/safe'# defaultscolors:
*error:colors.red# color of textstack:
*min:1# start line of stack error stringmax:5# end line of stack error stringdisplay:
*stack:true# set false to turn off logging for stack errorgeneric:true# set false to turn off logging for generic error
Notes
Setting generic to falsewill also silence stack
Changing Configration
changing stack options from function
simple-log= require '@partially-applied/simple-log'log= simple-log!log.stack 0,2# Error# at log.stack (C:\working\simple-log\simple-log.js:38:11)log.stack 1,3# at log.stack (C:\working\simple-log\simple-log.js:38:11)# at Object.<anonymous> (C:\working\simple-log\test.js:7:8)# at Module._compile (module.js:409:26)
changing display.stack option
simple-log= require '@partially-applied/simple-log'log= simple-log (display:(stack:false))
log.stack!# nothing gets logged - no side effects.