Skip to content

melalj/tonoid-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

Winston plugin for @tonoid/helpers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published