0.0.7 • Published 2 years ago
@tonoid/logger v0.0.7
@tonoid/logger
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