heimdalljs-logger
Structured logging via heimdalljs
Last updated 6 years ago by stefanpenner .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install heimdalljs-logger 
SYNC missed versions from official npm registry.

Usage

With no Heimdall Tree

var logger = require('heimdalljs-logger')('foo');

logger.trace('trace message');
logger.debug('debug message');
logger.info('info message');
logger.warn('warn message');
logger.error('error message');

console.log('app message');
DEBUG=foo DEBUG_LEVEL=trace foo
# =>  trace message
# ... debug message
# ... info message
# ... warn message
# ... error message
# ... app message

foo
# =>  app message

DEBUG=foo DEBUG_LEVEL=warn foo
# =>  warn message
# ... error message
# ... app message

With a Heimdall Tree

var heimdall = require('heimdalljs');
var config  = require('heimdalljs').configFor('logging');

config.matcher = (id) => /hai/.test(id.name);
config.depth = 2;

var logger = require('heimdalljs-logger')('foo');

heimdall.start('a');
heimdall.start('bhai');
heimdall.start('c');
heimdall.start('dhai');

logger.warn('warn message');
// => foo [bhai -> dhai] warn message

Current Tags

  • 0.1.10                                ...           latest (6 years ago)

10 Versions

  • 0.1.10                                ...           6 years ago
  • 0.1.9                                ...           8 years ago
  • 0.1.8                                ...           8 years ago
  • 0.1.7                                ...           8 years ago
  • 0.1.6                                ...           8 years ago
  • 0.1.5                                ...           8 years ago
  • 0.1.4                                ...           8 years ago
  • 0.1.3                                ...           8 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE