Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

em-logr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

em-logr

Bunyan/Pino Logger instance ready to use

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

logr

Bunyan / Pino Logger instance ready to use

Bunyan is really great for debugging purposes but Pino is crazily fast.

Thinking about that this package was created to use Bunyan whenever the LOG_LEVEL environmental variable is set to debug or trace;

INSTALL

npm install em-loger --save

Config

Logr will use bunyan if the LOG_LEVEL environmental variable has the values trace or debug and it will also enable the src option of bunyan automatically, which displays the filename along side with the line number on each log message.

Using LOG_LEVEL environmental variable with the values info, warn or trace will load pinojs which is faster and has a very similar api.

USAGE

    const logr = require('em-logr');
    
    logr.trace('My trace message');
    logr.debug('My debug message');
    logr.info('My info message');
    logr.warn('My warn message')
    logr.error('My error message');

Child loggers

    const
      _1stChildLogr = require('em-logr').child({name:'1stChild'}),
      _2ndChildLogr = require('em-logr').child({name:'2ndChild'});

    _1stChildLogr.info("The remote is mine, I am the first born child");
    _2ndChildLogr.info("The remote is mine, Mom likes me better");
    _1stChildLogr.warn("Get out of here or I'll hit you in the face!");
    _2ndChildLogr.info("Do not touch me or I'll tell mom to know about  secret.");
    _1stChildLogr.error("I did' see that coming!");

Keywords

FAQs

Package last updated on 13 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc