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

@magic/log

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magic/log

enhanced console.log

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
401
increased by16.57%
Maintainers
2
Weekly downloads
 
Created
Source

@magic/log

simple server side logging. basically console.log + loglevels

NPM version Linux Build Status Windows Build Status Coverage Status Greenkeeper badge

installation:
  npm install @magic/log
usage:
import
const log = require('@magic/log')
log levels
// set logLevel to all
log.setLevel('all')
log.setLevel(0)

// logLevel warn
log.setLevel('warn')
log.setLevel(1)

// only log errors:
log.setLevel('error')
log.setLevel(2)

// if production, set logLevel to "warn", if development, "all"
log.resetLevel()

// get current logLevel
log.getLevel()
log functions
// only outputs if logLevel === 'all'
log.info('Some interesting yet useless information')

// only outputs if logLevel === 'all'.
// output of first argument is green.
log.success('yay', 'only the first', 'argument was green')

// always outputs. first argument will be red
log.error('ERROR:', 'error messsage')

// outputs if logLevel === 'warn' || 'all'
log.warn('WARN:', 'warn message')

// make a message greyed out
log.annotate('Annotate this message')

FAQs

Package last updated on 12 Dec 2018

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