0.0.6 • Published 6 years ago
@yao-js/logger v0.0.6
Logger
Simple JSON logger.
Install
npm install @yao-js/loggerUsage
const { logger } = require("@yao-js/logger");
// you can pass in msg, info and error in any order
logger.$level(msg, info, error);Types
msg: stringinfo: plain objecterror:Errorlike object (with propernameandmessagefields)
Default Levels
- 60:
fatal - 50:
error - 40:
warn - 30:
info - 20:
debug - 10:
verbose
Default Options
see Default Options
Env Options
LOG_PRINT_LEVEL: numberLOG_PRINT_PRETTY: booleanLOG_ENABLE_TS: booleanLOG_ENABLE_TSS: boolean
Advanced
If you are not satisfied with the default logger and env options, you could build logger with pre-defined or customized bricks.
See
License
MIT