How to use the loglevelnext.getLogger function in loglevelnext

To help you get started, we’ve selected a few loglevelnext 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 storybookjs / SBNext / core / logger / node.js View on Github external
Object.defineProperty(opts, 'id', {
    get() {
      if (!id) {
        return this.name + (opts.unique ? `-${uuid()}` : '');
      }

      return id;
    },
  });

  if (opts.timestamp) {
    opts.prefix.template = `{{time}} ${opts.prefix.template}`;
  }

  const log = loglevel.getLogger(opts);

  if (!Object.prototype.hasOwnProperty.call(log, 'id')) {
    Object.defineProperty(log, 'id', {
      get() {
        return opts.id;
      },
    });
  }

  return log;
}
github webpack-contrib / webpack-log / src / index.js View on Github external
Object.defineProperty(opts, 'id', {
    get() {
      if (!id) {
        return this.name + (opts.unique ? `-${uuid()}` : '');
      }

      return id;
    },
  });

  if (opts.timestamp) {
    opts.prefix.template = `[{{time}}] ${opts.prefix.template}`;
  }

  const log = loglevel.getLogger(opts);

  if (!Object.prototype.hasOwnProperty.call(log, 'id')) {
    Object.defineProperty(log, 'id', {
      get() {
        return opts.id;
      },
    });
  }

  return log;
}

loglevelnext

A modern logging library for Node.js and modern browsers that provides log level mapping to the console

MPL-2.0
Latest version published 7 months ago

Package Health Score

63 / 100
Full package analysis