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

@everymundo/simple-logr

Package Overview
Dependencies
Maintainers
26
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everymundo/simple-logr

A very simplistic logger that allows one to avoid using the console.log directly allowing stubbing and better linting.

  • 1.2.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
26
Created
Source

@everymundo/simple-logr

A very simplistic logger that allows one to avoid using the console.log directly allowing stubbing and better linting.

It's just a simple wrapper around console./log|war|error/ with a few extra features.

installation

npm install @everymundo/simple-logr

usage

The environmental variable LOG_LEVEL can be used to change the log level for the logger. LOG_LEVEL default value is info. That means all your calls to logr.trace and logr.debug are not going to print anything out.

Assuming you run the (simple-usage.js)[ls examples/simple-usage/simple-usage.js] script with the environmental variable LOG_LEVEL=trace, you can see the expected result.

const logr = require('@everymundo/simple-logr');

logr.trace('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz TRACE: filename:lineNumber message
logr.debug('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz DEBUG: filename:lineNumber message
logr.info('message');  // outputs: YYYY-MM-DDTHH:mm:ss.zzz INFO: message
logr.warn('message');  // outputs: YYYY-MM-DDTHH:mm:ss.zzz WARN: message
logr.error('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz ERROR: message
logr.fatal('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz FATAL: message

If you clone this repo you can run the above examples with the help of npm scripts. Here are the steps:

git clone https://github.com/EveryMundo/simple-logr.git
cd simple-logr/examples/simple-usage
npm install

npm run trace
npm run debug
npm run info
npm run warn
npm run error
npm run fatal

Keywords

FAQs

Package last updated on 09 May 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