mlogtofile
v0.0.4
Published
Coloured console logs
Downloads
4
Readme
logToFile
An easy way to log to a file or coloured messages to console.
Installation
npm install mlogtofile
Usage
var Logger = require('mlogtofile');
var logger = new Logger('mylogfile.txt');
/* Log to a file */
logger.log('This is my message', 'log.txt');
/* Log to console (default green colour) */
logger.log('This is my message');
/* Log to console with chosen text colour */
logger.log('This is my message', 'blue');
/* Returning message with chosen text colour */
logger.log('This is my message', 'blue', true);
Output
[2 May 13:36:28]: This is my message
[2 May 13:36:48]: This is my another message 2
[2 May 13:37:55]: This is my another message 3