Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
blue-ox is a logging library inspired by debug by visionmedia. The justification for yet another logging library (tm) here is while debug is very handy, it doesn't support nice things for large long running apps. Things like different log levels, multiple destinations, blacklist or whitelisting from code, and parameters that can change after load.
var logger = require('blue-ox');
or var logger = require('blue-ox').beGlobal();
var log = logger(scope[, defaultLevel])
scope
is a path-like string separated by :
s. Each root scope gets a color from a round-robin list of colors to make them stand out a little more in the default output. If a logger is requested with a defaultLevel
and does not already exist, it will be created with the default level. If the logger already exists, the level is left as-is.
logger.beGlobal()
or logger.beGlobal(true)
sets up the global and returns the module.
logger.beGlobal(false)
tears the global down and returns the module.
log.color(color[, bright][, string])
The appropriate ANSI escape sequences are added only if logger.useColor
is true, and it defaults to true if node is run in a TTY.
If a string is supplied, then a reset will be inserted at the end of it. Otherwise, only an initial change sequence will be returned.
To output a reset, you can use log.color.reset()
. To dump out an ANSI code, you can use log.color.ansi(code)
.
var log = require('blue-ox')('mymodule');
// log an error
log.error(new Error('I will have a stack trace.'));
// log a warning
log.warn(new Error('I will also have a stack trace, but I will be labeled as WARN by default.'));
// sorta pretend we're using debug
var debug = log.debug;
debug('I will put out a debug message.');
// shared namespace, like debug
var child = require('blue-ox')('mymodule:child');
child.trace('I will have the same coloring as mymodule messages, but I will have a deeper namespace.');
// add a custom level
require('blue-ox').addLevel('foo');
child.foo('fooing'); // 'outputs FOO: mymodule:child > fooing' on the default console output
// color helper
log.info('Now listening on port ' + log.color('green', true, '3000'));
FAQs
Logging inspired by giants with axes.
The npm package blue-ox receives a total of 0 weekly downloads. As such, blue-ox popularity was classified as not popular.
We found that blue-ox 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.