Simple logger for Node.JS
- New files are created automatically when the day changes.
- Set labels for your messages;
$ npm install log-made-simple --save
var log = require('log-made-simple');
log.debug("My app is running...");
// will produce:
[DEBUG] May 31st 2016, 11:51:53 pm: My app is running...
log.info('Useful information');
log.warn('Be aware that something is going on...');
log.error('App has crashed...');
log.debug('Just checking around.');
You can use it to add some label to your log message. Example:
log.setLabel('app');
log.debug('Running...');
// will produce
[DEBUG] [app] June 1st 2016, 12:17:18 am: Running...
You can enable or not log file (default enabled).
If you do not want to log messages to your terminal, set it to false (default true).
Version 1.1.0 (June 7th, 2016)
- Added compatibility mode for Node.js versions under 6 (rest parameters are only available on >6).
Version 1.0.1 (June 1st, 2016)
- Added printf format string style to logger;
- Fixed flag options when creating stream.
Version 1.0.0 (May 31st, 2016)
- First release with basic usage.
Please, read the License file on this repository for more information.
Start contributing by forking and sending pull request.