num-easy-log
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Easy Logger

A simple wrapper for logging packages that supports switching to simple console logging to disable the underlying logging package.

By default logging uses pino, but pino can be bypassed by calling setConsoleOnly(true)

npm install num-easy-log

const easylog = require('num-easy-log');

const log = easylog.log;

// Logs using pino JSON format
log.error('Error message 1');

// Set the logging level and switch to console-only logging to bypass pino.
log.setLevel(easylog.Level.error);
log.setConsoleOnly(true);

// Logs using plain console logs.
log.info('Should not see this.');
log.error('Error message 2');

Readme

Keywords

none

Package Sidebar

Install

npm i num-easy-log

Weekly Downloads

2

Version

0.0.2

License

Apache-2.0

Unpacked Size

19.4 kB

Total Files

10

Last publish

Collaborators

  • frednum
  • twalmsley