![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
@node-lightning/logger
Advanced tools
Readme
Logger for Node-Lightning modules that supports multi-transport, multi-area+instance logging using standard util.format
sprintf value formatting.
npm install @node-lightning/logger
To use the module you will need to create an area logger and include an optional instance identifier:
const { manager } = require("@node-lightning/logger");
const area = "TEST";
const instanceId = "12345678";
const log = manager.create(area, instanceId);
Then you can write debug
, info
, warn
, and error
messages by passing a message an a variadic number of values. You can pass text, values, sprintf syle strings, or a string and a list of values that will be appended to the end of the message.
log.debug("test");
log.info("hello");
log.warn("i'm warning you");
log.error("something went bad");
log.error(new Error("booooom"));
log.info("some stuff %j", { ok: true, foo: "bar" });
log.info("some values", 1, 2, 3, 4);
log.info("using %s formatting", "sprintf");
The above message should look similar to:
2019-07-22T13:28:37.854Z [DBG] TEST 12345678: test
2019-07-22T13:28:37.855Z [INF] TEST 12345678: hello
2019-07-22T13:28:37.855Z [WRN] TEST 12345678: i'm warning you
2019-07-22T13:28:37.855Z [ERR] TEST 12345678: something went bad
2019-07-22T13:28:37.856Z [ERR] TEST 12345678: Error: booooom
at Object.<anonymous> (/code/go/src/github.com/altangent/node-lightning/packages/logger/test.js:9:11)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-07-22T13:28:37.856Z [INF] TEST 12345678: some stuff {"ok":true,"foo":"bar"}
2019-07-22T13:28:37.856Z [INF] TEST 12345678: some values 1 2 3 4
2019-07-22T13:28:37.856Z [INF] TEST 12345678: using sprintf formatting
The default instance of the logger will output to:
console
node-lightning.log
file located at the root of the application runtimeFAQs
Logging tool for Node-Lightning applications
The npm package @node-lightning/logger receives a total of 33 weekly downloads. As such, @node-lightning/logger popularity was classified as not popular.
We found that @node-lightning/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
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.