1.0.2 • Published 6 years ago
@downstacks/downlogger v1.0.2
Downlogger
Description
Downlogger is a NodeJS logger.
Installation
$ npm install @downstacks/downlogger
Usage
Basic usage
const Logger = require('@downstacks/downlogger');
var logger = new Logger();
logger.log('This is a log message');
Store logs in a file
For logging in console and in the log file :
var logger = new Logger('path/to/file.log');
logger.log('This is a log message and it is written in a file');
For logging only in the log file :
var logger = new Logger('path/to/file.log', false);
logger.log('This is a log message only written in a file');
Log functions
Logging information message :
logger.info('Log message');
Logging debug message (with traces enabled by default) :
logger.debug('Log message');
Logging warn message :
logger.warn('Log message');
Logging error message :
logger.error('Log message');