@roosoft/logger
v0.1.1
Published
Manage application execution information with loglevels and templates
Readme
logger
Manage application execution information
Environment variables
LOG_LEVEL | Values
--- | :---
Available | trace, debug, info, warn, error
Default | info
LOG_FORMAT | Values
--- | :---
Available | raw, json, console
Default | console
LOG_DATE_FORMAT | Values
--- | :---
Available | see moment.js formats
Default | YYYY-MM-DD
LOG_TIME_FORMAT | Values
--- | :---
Available | see moment.js formats
Default | H:mm:ss.SSS
How to use
Setup environment log level and format environment variables in your application. When logging from files, first require this library.
const log = require('logger')Then log in a similar way you would use console.log, except using one of these:
log.tracelog.debuglog.infolog.warnlog.error
Example
log.info('what is happening right now')