UNPKG

i-log

Version:
37 lines (30 loc) 732 B
# i-log Share logger between nodejs modules. Use a dedicate key for each module and filter the module you want is writing. ## Install ```sh $ npm install --save i-log ``` ## Configuration setting DEBUG variable when run your modules ```sh # print all keys DEBUG=i_log:* npm start ``` ```sh # print info keys DEBUG=i_log:info npm start ``` ## Usage ```sh var i_log = require('i_log')("your_module") i_log.info("test info") i_log.debug("test debug") i_log.error("test error") ``` ## Output ```sh your_module:info Wed Oct 19 2016 16:53:03 GMT+0200 (CEST) test info +0ms your_module:debug Wed Oct 19 2016 16:53:03 GMT+0200 (CEST) test debug +117ms your_module:error Wed Oct 19 2016 16:53:03 GMT+0200 (CEST) test error +117ms ```