New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nebulog

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nebulog

A enhancement/wrapper around the wonderful Winston logger.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

nebulog

A enhancement/wrapper around the wonderful Winston logger.

Installation

Installing npm (node package manager)

  curl http://npmjs.org/install.sh | sh

Installing nebulog

  [sudo] npm install nebulog

Motivation

Winston is a great logger, but there were a few minor issues about it that I didn't like, or features I wish it had. The enhancements over a vanilla implementation of Winston are:

  • Outputting the filename of the file from which the logging message came from.
  • Aligning the logging message by adding padding after the severity level.
  • Use a more JSON-like syntax when printing the metadata object.
  • Allow arbitrarily many metadata objects to be logged, rather than just one.

Example usage:

Basic Usage

  var logger = require('nebulog').make({filename: __filename});

  logger.log('info', 'Logger is working');
  logger.info('This also works');

Setting minimum log level

  var logger = require('nebulog').make({filename: __filename, level: 'warn'});

  logger.warn('This will be visible.');
  logger.info("But this won't");

The log available log levels, from least serious to most serious, are:

['silly', 'verbose', 'info', 'warn', 'debug', 'error'];

Logger per function

  var loggerA = require('nebulog').make({filename: __filename + ':A'});
  var loggerB = require('nebulog').make({filename: __filename + ':B'});

  function A() {
    loggerA.info('This log message will be marked as coming from A');
  }

  function B() {
    loggerB.info('But this log message will be marked as coming from B');
  }

FAQs

Package last updated on 08 Feb 2016

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