0.1.1 • Published 3 years ago
@gustavomartinez/logger v0.1.1
Logger
Simple logger interface.
Usage
The logger instance is the object returned by the main exported Logger function
const Logger = require('logger');
const
transportsConsole = new Logger.Console({
type : 'console',
level : 'debug',
colorize : true,
timestamp : true,
}),
transportsFile = new Logger.File({
type : 'file',
level : 'debug',
filename : 'logs/combined.log',
tailable : true,
}),
logger = new Logger.Logger(
'info',
[transportsConsoleSettings, transportsFileSettings],
);
The primary goal of the logger instance is to provide logging methods.
Methods
The default logging methods are debug
, info
, warn
, error
, verbose
and silly
.
The parameters are explained below using the logger.info
method but the same applies to all logging methods previously mentioned.
info(message: string, ...meta: any)
Example:
logger.info('Hello, this is cobrowser logger');