mperdeck/jsnlog.js

Disable the logger

SvetoslavStefanov opened this issue · 2 comments

Hello,
How can I disable the logger ? I want the logger to be enabled only on production.

To enable/disable the entire library (that is, all loggers), set the enabled field:
http://jsnlog.com/Documentation/Configuration/JSNLog
http://jsnlog.com/Documentation/JSNLogJs/JL/SetOptions

I just want to add one thing, that might confuse someone, as it confused me.
JL.setOptions({ "appenders": [appender], "enabled": !backEndConfig.config.canDebug });
To set options call JL. and not JL().setOptions, because the second one wouldn't set "enabled" to false, and there is no error for calling JL(). so it's a bit hard to catch this.