@raj30/logger
v1.0.3
Published
Custom logger made on top of Pino
Downloads
5
Readme
Logger
Hi! This Logger is built on top of Pino .
It exposes all the log levels same as that of Pino in the following order except for silent.
Level - Weight
trace - 10
debug - 20
info - 30
metric - 45
warn - 40
error - 50
fatal - 60
Sample Usage
Please refer the samples section in the repository
Specification
All the level methods of this logger accepts 3 params in the same order,
Message Object,
Tracing Id (optional),
Type of Log indicating failure, success log etc.., (optional)
Please refer the exported types or the types file inside types file for more info on the params structure.
Note
Instance of Error is only allowed on the key "error" in the messageObject only.
The error key in messageObject will be stringified to {message, stack } only in warn, debug, error, fatal. Other level doesn't suppport Error instance in the log.