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

@paulavery/logger

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

@paulavery/logger

A simple logger

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

A simple logger

This library provides a simple logger to use in your application. It supports namespaces, custom reporters and outputs data as JSON (with the option to prettify output in development).

It is build atop of the @paulavery/events library. Full documentation can be found here.

Example

import Logger from '@paulavery/logger';

let logger = new Logger({ debug: true });

/* A message and some data */
logger.trace('Trace info!', { some: 'data' });

let childLogger = logger.child('scope', { some: 'more', scope: 'data' });

/* Logging without data */
childLogger.info('Some information');

/* Logging without message */
childLogger.warn({ more: 'here' });

/* Overriding scope */
childLogger.error('Shit happened!', { some: 'stuff' });

JSON output (debug = false)

{"time":1465295505440,"scope":[],"level":"trace","message":"Trace info!","data":{"some":"data"},"levelNumeric":0}
{"time":1465295505444,"scope":["scope"],"level":"info","message":"Some information","levelNumeric":100}
{"time":1465295505445,"scope":["scope"],"level":"warn","data":{"some":"more","scope":"data","more":"here"},"levelNumeric":200}
{"time":1465295505445,"scope":["scope"],"level":"error","message":"Shit happened!","data":{"some":"stuff","scope":"data"},"levelNumeric":300}

Debug output Debug Output

FAQs

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