No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.babelrc
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
index.config.js
package.json
test.config.js
yarn.lock

README.md

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