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

fancy-log-levels

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fancy-log-levels

Log things, prefixed with a timestamp and level. Choose what to log, based on verbosity level.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

fancy-log-levels

NPM version Downloads

Log things, prefixed with a timestamp and level. Choose what to log, based on verbosity level.

Usage

var log = require('fancy-log-levels');
log(3)

log.debug('a message');
// [16:27:02] [D] a message

log.error('oh no!');
// [16:27:02] [E] oh no!

API

log(lvl)

Sets the debug level.

  • -1 is mute
  • 0 is error and user-info
  • 1 is warning
  • 2 is info
  • 3 is debug

log.debug(msg...)

Logs the message as if you called console.log but prefixes the output with the current time in HH:MM:ss format and [D].

log.error(msg...)

Logs the message as if you called console.error but prefixes the output with the current time in HH:MM:ss format and [E].

log.warn(msg...)

Logs the message as if you called console.warn but prefixes the output with the current time in HH:MM:ss format and [W].

log.info(msg...)

Logs the message as if you called console.info but prefixes the output with the current time in HH:MM:ss format and [I].

log.user(msg...)

Logs the message as if you called console.info but prefixes the output with the current time in HH:MM:ss format and [I].

log.dir(msg...)

Logs the message as if you called console.dir but prefixes the output with the current time in HH:MM:ss format and [D].

License

MIT

Keywords

FAQs

Package last updated on 07 Jul 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