Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

logd

distributed-systems2.8kMIT5.1.11TypeScript support: included

A powerful modular logging facility for node.js

log, logger

readme

logd

A powerful modular logging facility for node.js

npm

Using Logd

In the main file of your application or library, import the module, define a namespace and set a transport for the log output.

import logd from 'logd';

// define the module we're logging from
const log = logd.module('my-service');


// start logging
log.info('some information');


// you may pass as many arguments as you like 
// to the log methods
log.error('something went wrong', err, {some: 'data'});

Enable logs: Node

node mysript.js --l
node mysript.js --l --warn
node mysript.js --log
node mysript.js --log --level=debug

Enable logs: Browser

in the console

logd.enable();
logd.enable('error');