1.1.1 • Published 4 years ago
darla v1.1.1
Simple logger to both console and file and levels with no dependencies.
Usage:
Install
npm i darlaOR
yarn add darlaImport
const darla = require("darala)Log debug:
dara.debug("this is debug message")Log info:
darla.info("New order", order)Log warning:
darla.warn("This could lead to an error in the future" + "fix now")Log error:
darla.error(err)Change path to log file output:
darla.setLogFilePath("/Users/alice/logs/project.log")Modify config:
darla.modifyConfig("console", "error", false)Set log level:
darla.setLevel("file", "error")Potential levels: debug, info, warn, error, off
Default config:
let config = {
console : {
debug : true,
info : true,
warn : true,
error : true
},
file : {
debug : true,
info : true,
warn : true,
error : true
}
}