lark-log
This is Lark.js log module.
Useage
sample
const LarkLogger = ; const logger = 'using-default': true ; logger;
configure
const LarkLogger = ; const logger = ; const config = "@description": "This is the default config" "level": 1 "methods": "debug": "level": 1 "output": "console" "print": "level": 2 "output": "console" "trace": "level": 2 "output": "system" "notice": "level": 3 "output": "system" "warn": "level": 4 "output": "system" "error": "level": 5 "output": "error" "fatal": "level": 5 "output": "error" "outputs": "default": "line-max-length": 2000 "format": "<%= method.toUpperCase() %>:\t<%= date('yyyy-mm-dd HH:MM:ss')%>\t<%= content %>" "path-prefix": "logs/" "path-suffix": ".log" "console": null "system": "path": "system" "error": "path": "system" "path-suffix": ".log.wf" ; logger; logger;// write "debug " to terminallogger;// write "NOTICE: {DATETIME} notice" to system.log, {DATETIME} is in "yyyy-mm-dd HH:MM:ss" stylelogger;//write to system.log.wf
logrotate
logger.configure({
"outputs": {
"default": {
"path-suffix": ".log.<%= date('yyyymmddHH') %>"
}
}
});
- If '<%' exists in path (including prefix and suffix), the path will be regarded as a dynamic path. LarkLog calculates the path every when an output came.