@nsilly/log
v3.0.0
Published
The nSilly Log package.
Downloads
108
Readme
NSilly Logger
Introduction
NSilly Logger based on winston. It's a Logger that can help you learn what's happening within your application, NSilly Log provides a logging service that can help you write your log message to file or transfer them to anywhere.
Configuration
Log Levels
NSilly Logger offers all of the log levels defined in the RFC 5424 specification: emergency, alert, critical, error, warning, notice, info, and debug.
So, imagine we log a message using the debug method:
import { Logger } from '@nsilly/log';
const logger = new Logger();
logger.debug('Message goes here', { data: 'context' });
Usage
import { Logger } from '@nsilly/log';
// If you want to log an error message
const logger = new Logger();
logger.error('Message goes here', { data: 'context' });
// or
logger.log('error', 'Message goes here', { data: 'context' });