You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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
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

console.log

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