0.0.7 • Published 6 months ago

@fict/logger v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

How to use @fict/logger

@fict/logger allows multiple modules to use a logger at the same time. From each of the modules initialize it as below:

const logger = require('@fict/logger').defaultInit('../package.json', { logConfigFolder: __dirname + "/../../config/logger" });

In the package.json you can set custom property logLabel to any value that you want to show in the logs as the name of the module. If not set, the name of the package will be used by default.

The logger created above is a child object that comes in-built with {src: logLabel} context for the log. To use the logger just use any of the info, debug, warn or log methods as usual:

  app.logger.info(`Server started at ${host}:${port}`)

To add any additional context, use it as below:

  app.logger.info({additionalCtx: value}, `Server started at ${host}:${port}`)
0.0.5

7 months ago

0.0.7

6 months ago

0.0.6

7 months ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago