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

@pager/logger

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pager/logger

Logging library

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
960
decreased by-73.18%
Maintainers
1
Weekly downloads
 
Created
Source

logger

Circle CI Code Climate Test Coverage js-standard-style

Logging library for your verbose projects.

Basic usage

Works basically as a wrapper for Bunyan's console and [console] and [raven] transports. For more details on how to work with Bunyan, take a look at its documentation or see configuration below for the setup details.

Installation

This is a private npmE package, so in order to use it, make sure you have something that resembles the following .npmrc on your project's folder:

@pager:registry=http://npme.techcareinc.com:8080/
//npme.techcareinc.com:8080/:_authToken=${NPM_TOKEN}

Note that this requires the NPM_TOKEN env var to be exported as a GitHub Personal Access Token.

Usage

'use strict'

const logger = require('@pager/logger');
logger.log('Hello, World', 'Everyone knows', { foo: 'the dice are loaded' });

PROTIP: When running your app, remember you can get pretty output by simply piping it to bunyan :godmode: .

For detailed usage examples, take a look at the examples folder.

Configuration

Most of the bundled transports can be configured on your app by simply declaring a log key on your config settings.

Sample configuration

{
  "log":{
    "patchGlobal": true,
    "levels":{
      "console":"debug"
    }
  }
}

If you keep getting a No configurations found in configuration directory WARN, try disabling the alerts by setting the SUPRESS_NO_CONFIG_WARNING env var to a truthy value.

Sentry

In order to enable the Sentry/Raven transport, the SENTRY_DSN env var needs to be set.

Custom transports

You can extend the default functionality of this module by adding your own transports:

'use strict'

// Require the transport
const localFileTransport = require('winston').transports.File;

// Require the logger
const logger = require('@pager/logger');

// Add and setup the transport
logger.add(localFileTransport, { name: 'localFile', filename: 'test.log' });

Keywords

FAQs

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

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