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

devnull

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devnull

A simple logger with automatic function detection.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-94.44%
Maintainers
1
Weekly downloads
 
Created
Source

dev/null (because logging to /dev/null is really fast!)

devnull is an advanced logging module for Node.js it was designed from the ground up to assist you during development and powerful in production. It works just like the console.log statements, it uses the same formatter, everything. This is basically a cherry on top :).

namespacing

It automatically adds intelligent name spacing to all your log calls so you can easily spot where the log messages are coming from, without having to remember all the locations of your log statements.

evented

The logger is build upon the EventEmitter prototype so you can listen when certain events are fired. You might want to send an e-mail out for every critical log message you receive. I know I would.

customizable

It comes with a ton of options, that could customize. Or not. It's up to you.

Installation

npm install devnull

API

initializing
var Logger = require('devnull')
  , logger = new Logger;

This initializes the default logger. You can configure the logger by passing in a options object.

var Logger = require('devnull')
  , logger = new Logger({ timestamp: false });

The available options:

  • env either development or production, default is based on isatty.
  • level log level, defaults to 8.
  • notification when do start emitting notification errors, defaults to 1.
  • timestamp do the logs needs to stamped, defaults to true.
  • pattern pattern for the time stamp, defaults to node's util log format.

The timestamp pattern is based on the 140bytes gist but it also allows execution of functions like {Fullyear} - {toLocaleTimeString}

methods

The logger ships with these methods by default.

  • alert
  • critical
  • error
  • warning
  • metric
  • notice
  • info
  • log
  • debug
logger.critical('omg the server is on fire',  { obj: 'works like console.log' });

Keywords

FAQs

Package last updated on 16 Nov 2011

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