🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

logget

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logget

A wrapper around winston logger for scalable application logging

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

logget

NPM version Dependency Status Dev Dependency Status Code Climate Build Status Coverage Status

A simple wrapper around winston that helps give context to your logs.

Deprecated. Opt to use winston or bunyan directly.

Installation

npm install --save logget

Usage

Simple usage:

The object that gets returned can be used like a winston logger instance.

var log = require('logget')();

log.silly('silly log');
log.debug('debugging all the things');
log.verbose('blah blah blah');
log.info('logging stuff...');
log.warn('hey shouldn\'t we fix that?');
log.error('release the kraken');

Advanced usage:

If you pass in a string to the function, it will prefix your messages with that string wrapped around square brackets.

// app.js
var log = require('logget')('app');
log.info('testing'); // Will log out "info: [app] testing"

// model.js
var log = require('logget')('model');
log.info('testing'); // Will log out "info: [model] testing"

Expert usage:

You can customize what transports, log levels, level colors, and anything else you can pass into new winston.Logger().

var Log = require('logget');
// You can only call .configure once, and it must be before you make a new log.
Log.configure({
  transports: [
    new Log.transports.Console({colorize: true})
  ],
  levels: {
    foo: 0,
    bar: 1,
    baz: 2,
    foobar: 3
  },
  colors: {
    foo: 'green',
    bar: 'blue',
    baz: 'yellow',
    foobar: 'red'
  }
});

// now in this file or any other that gets `required` after this one:
var log = require('logget')();
log.foo('bar');
log.bar('foo');
log.baz('zab');
log.foobar('hello world');

Keywords

log

FAQs

Package last updated on 18 Apr 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