@tonoid/logger

0.0.7 • Public • Published

@tonoid/logger

npm npm npm GitHub stars

Winston plugin for @tonoid/helpers.

Exported context attributes

  • .info(): Log into console (info level)
  • .error(): Log into console (error level)
  • .warn(): Log into console (warn level)
  • .debug(): Log into console (debug level)
  • .winston: Winston alias
  • .format: Winston formatting alias

Usage example

const { context, init } = require('@tonoid/helpers');
const logger = require('@tonoid/logger');

(async () => {
  // You need to initialize the helpers first before calling the logger from the context
  await init(
    [],
    {
      logger,
      loggerOptions: {
        json: false,
        colorize: true,
        prettyPrint: true,
        splat: true,
        simple: true,
      },
    },
  );

  context.logger.info('Hello World');
})();

Credits

This module is maintained by Simo Elalj @tonoid

Package Sidebar

Install

npm i @tonoid/logger

Weekly Downloads

4

Version

0.0.7

License

MIT

Unpacked Size

5.12 kB

Total Files

6

Last publish

Collaborators

  • melalj