Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
const {debug,error,warn,info } = require("b-logger")("logger.tag")
debug("debug")
error("error")
debug
,error
,warn
,info
are logger functions.
logger.tag
is a name of the four functions.
//logger function
(message:string,...params:any[])=>void
b-logger
read json and config log4js.
Example:
{
"level": "debug",
"error": {
"path": "./log/error.log",
"fileNamePattern": "-dd"
},
"warn": {
"path": "./log/warn.log",
"fileNamePattern": "-dd"
},
"info": {
"path": "./log/info.log",
"fileNamePattern": "-dd"
},
"debug": {
"path": "./log/debug.log",
"fileNamePattern": "-dd"
},
"options":{
"console":{
"exclude":[
".*"
],
"include":[
"^debug"
]
}
}
"options.dev":{
}
}
pattern see here
options
exclude
is an array of RegExp string that used to specify which loggers will be excluded (output nothing to console)
include
is an array of regexp string also and it was used to specify which loggers will be included.
If no exclude
and include
fields ,all the log will be output.
If a logger's name matchs exclude
and include
, it will be included
maxPathLength
is a number to specify the max path length on the log header. -1 is infinite.
maxFuncNameLength
is a number to specify the max function name on the log header.
time
is a time format ,such as YYYY-MM-DD hh:mm:ss
layout
is a string to describe the log header's layout.
For example, [%t] [%n] [%p]
will be process to generate [11:53] [test] [@anonymous -ogger/src/exp.ts:8:3]
options.dev
options.dev
has the same structure with option
which used to overwrite option.console
if NODE_ENV or B_LOGGER was set to dev
FAQs
logger
We found that b-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.