
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
log-factory
Advanced tools
A little log library that makes it simple to add [winston](https://github.com/winstonjs/winston) loggers to your module.
A little log library that makes it simple to add winston loggers to your module.
import {buildLogger} from 'log-factory';
let logger = buildLogger();
The logger category is named after the module that called buildLogger
. So if your file was called utils/index.js
the logger category will be [utils]
.
By default logging targets the console with a level
of info
. You can change this by calling init
.
import {init} from 'log-factory';
/**
* Will only affect loggers created after the call to init.
* It is advisable to call this at the start of your app
* before any log instances have been created.
*/
init({
console: false,
file: 'my-log.log',
log: 'INFO'
});
The options for init
are:
true
undefined
'info'
If you want to disable logging you can pass in:
{console: false, file: undefined}
If using json you can define levels for different categories. For example:
{
"app": "info",
"item" : "debug"
}
default
is a special category that will be applied if the category can't be found.
To see the available categories, first run the log with level silly
, the name in the square brackets is the category.
npm test
npm run main
add release-helper
to the build (will need to be updated to work with gulp 4.0).
FAQs
A little log library that makes it simple to add [winston](https://github.com/winstonjs/winston) loggers to your module.
We found that log-factory 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.