node-async-logger
Asynchronous logger on NodeJs.
Install
npm install node-async-logger
Usage
const logger = ; let log = ; log; log; // ! Important
Methods
error, err, e
Log error information
Example
log;// yyyy-mm-dd hh24:mi:ss.ms ERROR This is error
warning, warn, w
Log warning information
Example
log;// yyyy-mm-dd hh24:mi:ss.ms WARN This is warning
information, info, i
Log information
Example
log;// yyyy-mm-dd hh24:mi:ss.ms INFO This is information
debug, d
Log debugging information
Example
log;// yyyy-mm-dd hh24:mi:ss.ms DEBUG This is debugging
time(name, nolog)
Mark current time as the starting point for calculating eslapse time
Parameters
- name String
- nolog Boolean (optional, default: false)
- return Date object
Example
log;// yyyy-mm-dd hh24:mi:ss.ms TIME somename (Thu Sep 28 2017 15:32:27 GMT+0000 (UTC))
eslapse(name, reset, nolog)
Get eslapsed time from the marked time named by name
Parameters
- name String
- reset Boolean (optional, default: false)
- nolog Boolean (optional, default: false)
- return Number Eslapsed time (ms)
Examples
log;// yyyy-mm-dd hh24:mi:ss.ms ESLAPSE somename ( 000 ms )
Bugs or feature requests
Please contact to email
(Please add the prefix "[node-async-logger]" into the email title. Thanks!)