
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Logging library that allows for hierarchical loggers, multiple log levels, and flexible watching of log records.
This is a logging library for use with node.js. It decouples log reporting from publishing and is based on the Java API.
Fork the latest source from github.
or
npm install logg
Call getLogger(name)
with the name of your class, namespace, or made up identifier.
Loggers expose fine()
, info()
, warn()
, error()
and log(level, args)
. These logging methods take variable arguments and will call sys.inspect
on any objects that are passed. There is special handling for Error objects.
var logging = require('logg');
var logger = logging.getLogger('my.class);
logger.setLogLevel(logging.Level.WARN);
logger.info('This will not show up');
logger.warn('But warnings will', new Error('aargg'));
Loggers are arranged in a hierarchy based on their names, separated by dots. Log reporting levels are inherited based on the hierarchy, INFO being the default level. For example, the following will silence everything but errors within the subproject
namespace:
var a = logging.getLogger('project.subproject.foo');
var b = logging.getLogger('project.subproject.bar');
var c = logging.getLogger('project.subproject.baz');
var d = logging.getLogger('project.subproject.bam');
logging.getLogger('project.subproject').setLogLevel(logging.Level.SEVERE);
Every logger can have watchers associated with it, which will get called with a log record. Usually you'd just want to attach to root logger.
logging.registerWatcher(function(logRecord) {
// Don't use sync API in real life...
fs.writeFileSync('logs.log', JSON.stringify(logRecord) + '\n');
});
A default watcher is automatically registered which outputs to the console.
FAQs
Logging library that allows for hierarchical loggers, multiple log levels, and flexible watching of log records.
The npm package logg receives a total of 43 weekly downloads. As such, logg popularity was classified as not popular.
We found that logg 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.