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

@pager/logger

Package Overview
Dependencies
Maintainers
15
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pager/logger

Logging library

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
960
decreased by-73.18%
Maintainers
15
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.

'use strict';

const logger = require('@pager/logger');
logger.info({ foo: 'bar' }, 'Everyone knows %s', '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"
    }
  }
}

Sentry

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

Installation

This is a private npm package, so 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.

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 30 Jun 2017

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