Simple logging module
Easier logging!
Summary
Simple logging module. Uses Pino.
Read more in Pino's documentation. This module simply wraps calls to the
corresponding Pino call, i.e. logger.info(args)
calls pino.info(args)
.
Environment variables
This module reads process.env['NODE_ENV']
to determine whether it should log or not.
- Set
process.env['NODE_ENV']
toproduction
, thenlogger.debug
will not work. - Set
process.env['NODE_ENV']
totest
, then onlylogger.debug
will work.
Pino config
The first argument passed to frivillig-logger
will be passed as config to Pino.
To see which config options you have, go to Pino's own documentation.
Example usage
Below is a short example of how you can use this module.
const logger = level: 'debug' name: 'my-application'; ;logger;logger;logger;logger;