@nsilly/log

The nSilly Log package.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@nsilly/log
103.0.05 years ago6 years agoMinified + gzip package size for @nsilly/log in KB

Readme

NSilly Logger
- [Introduction](#introduction)
- [Configuration](#configuration)
- [Log Levels](#log-levels)
- [Usage](#usage)

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' });