Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

davlog

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

davlog

The logger davglass uses in his CLI tools

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
29
-67.05%
Maintainers
2
Weekly downloads
 
Created
Source

davlog

This is the logger that I use in my CLI tools.

usage


var davlog = require('davlog');

var logger = davlog.init({
    name: 'foo',
    color: 'white'
}); //Should only need once

logger.info('This is a test');

foo [info] This is test

Note that the module is an instance of itself, with the default options:


var davlog = require('davlog');

logger.info('This is a test');

davlog [info] This is test

methods

  • info
  • log
  • warn
  • err
  • error Will process.exit(1) when called.
  • silent Disable all output
  • quiet Disable all but log and info

options

The init function allows for 3 options:

  • name - The name prefix to the string: Defaults to: 'davlog'
  • color - The string for the color or false to disable color: Defaults to magenta
  • timestamps - If true, adds an ISO timestamp to the beginning of each log line.
  • stdout - A writeable stream for normal log messages: Defaults to process.stdout
  • stderr - A writeable stream for error log messages: Defaults to process.stderr

You can override all prefixes by using the: logger.STRINGS object. You can override all default colors by using the logger.COLORS object.

There are also stdout and stderr properties on the object, which are readable streams. These are useful for piping log data elsewhere.

build status

Build Status

node badge

NPM

Keywords

cli

FAQs

Package last updated on 08 Jan 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