@klluster/logger v1.0.3
@klluster/logger
Nodejs library for loggin messages to the console or centralized logging system
Installation
npm install --save @klluster/logger
Usage
Use one of the following methods below to log a message:
logger.error()
logger.warn()
logger.info()
logger.debug()
These methods are pretty flexible so they pretty much accept any amount of arguments. See some examples below
const logger = require('@klluster/logger');
logger.info('logging useful information here...');
logger.error('Something went wrong', new Error());
// warn
logger.warn('do not delete');
// metadata...
logger.info('a lot of data here', { state: 'loggin' }, { info: 'extra data here...' });
Log levels
Details of log levels are given below:
Info
the standard log level indicating that something happened application entered a certain state, etc.
Warn
the log level that indicates that something unexpected happened in the application, a problem, or a situation that might disturb one of the processes. But that doesn’t mean that the application failed.
Error
the log level that should be used when the application hits an issue preventing one or more functionalities from properly functioning.
Debug
Provides fine-grained informational events that are most useful to debug an application.