
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@vizir/simple-json-logger
Advanced tools
The simplest json logger. Include typescript definitions.
A fast, simple and opinionated json logger to stdout.
This library is designed to be an easy and fast way to log json messages to stdout
.
If you want a more advanced solution, we recommend to you use winston.
$ npm install @vizir/simple-json-logger
const { Logger } = require("@vizir/simple-json-logger");
const logger = new Logger({
app: "ConsoleApplication",
requestId: "3a7d3223-e96f-47da-b3bb-73f609b9f55d",
});
logger.debug("debug message", { extraInfo: 123 });
logger.info("info message", { extraInfo: "abc" });
logger.warn("warn message", { moreInfo: "abc123" });
logger.error("error message", { otherInfo: "qwerty" });
By default, the logger will filter some sensitive values from logs output. They will verify if an object key, contain some of the following words: (The validation is case insensitive)
You can add or remove the default blacklist, using the includeBlackList or excludeBlackList attribute into options, as following:
const logger = new Logger(
{
app: "ConsoleApplication",
requestId: "3a7d3223-e96f-47da-b3bb-73f609b9f55d",
},
{
includeBlackList: ["myPasswordField"],
excludeBlackList: ["accessToken"],
}
);
logger.error("error message", { myPasswordField: "qwerty" });
The output of the following command are:
{
"app": "ConsoleApplication",
"requestId": "3a7d3223-e96f-47da-b3bb-73f609b9f55d",
"level": "error",
"datetime": "2020-05-20T00:20:10.432Z",
"message": "origin: error message",
"myPasswordField": "*sensitive*"
}
Tested in Node.js 10-12.
FAQs
The simplest json logger. Include typescript definitions.
The npm package @vizir/simple-json-logger receives a total of 18 weekly downloads. As such, @vizir/simple-json-logger popularity was classified as not popular.
We found that @vizir/simple-json-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.