How to use the heimdalljs.configFor function in heimdalljs

To help you get started, we’ve selected a few heimdalljs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heimdalljs / heimdalljs-logger / tests / index.js View on Github external
it("reads matcher and depth from heimdall's logging config if present", function() {
    let logConfig = heimdall.configFor('logging');

    logConfig.depth = 1;
    logConfig.matcher = (id) => id.name == 'hello';

    let prefixer = new Prefixer();

    heimdall.start({ name: 'hello' });
    heimdall.start({ name: 'somemthing-else' });
    heimdall.start({ name: 'hello' });

    expect(prefixer.prefix()).to.match(/\[hello#\d\] /);
  });
github ember-cli / ember-cli / lib / cli / index.js View on Github external
function configureLogger(env) {
  let depth = Number(env['DEBUG_DEPTH']);
  if (depth) {
    let logConfig = require('heimdalljs').configFor('logging');
    logConfig.depth = depth;
  }
}
github heimdalljs / heimdalljs-logger / src / prefixer.js View on Github external
constructor() {
    let logConfig = heimdall.configFor('logging');

    this.matcher = logConfig.matcher || MATCHER;
    this.depth = typeof logConfig.depth === 'number' ? logConfig.depth : 3;
  }

heimdalljs

Structured instrumentation library

MIT
Latest version published 6 years ago

Package Health Score

59 / 100
Full package analysis