Skip to content

bpinhosilva/log-made-simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log-made-simple

Simple logger for Node.JS

Features

  • New files are created automatically when the day changes.
  • Set labels for your messages;

Installation

$ npm install log-made-simple --save

Quick example

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...

Reference

Basic methods

log.info('Useful information');
log.warn('Be aware that something is going on...');
log.error('App has crashed...');
log.debug('Just checking around.');
setLabel(String)

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...
setOutputFile(Boolean)

You can enable or not log file (default enabled).

setDebugMode(Boolean)

If you do not want to log messages to your terminal, set it to false (default true).

Changelog

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.

License

Please, read the License file on this repository for more information.

Do you like it?

Start contributing by forking and sending pull request.

About

Simple logger for Node.JS

Resources

License

Stars

Watchers

Forks

Packages

No packages published