0.1.1 • Published 3 years ago

@gustavomartinez/logger v0.1.1

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
3 years ago

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

3 years ago

0.1.0

3 years ago