logd
TypeScript icon, indicating that this package has built-in type declarations

5.1.9 • Public • Published

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');

Readme

Keywords

Package Sidebar

Install

npm i logd

Weekly Downloads

1,496

Version

5.1.9

License

MIT

Unpacked Size

52.3 kB

Total Files

42

Last publish

Collaborators

  • ee