@klluster/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@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.

Readme

Keywords

none

Package Sidebar

Install

npm i @klluster/logger

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

24.8 kB

Total Files

29

Last publish

Collaborators

  • klluster