The `log` package provides a universal and pluggable logging utility designed for JavaScript applications, currently stable at version 6.3.2. It focuses on being configurable, environment, and presentation agnostic, differentiating itself by not handling output directly but emitting events for external 'writers' (e.g., `log-node` for Node.js environments). Releases are made as needed, with several maintenance and minor feature updates occurring within the last few years. Key features include syslog-compatible log levels (debug, info, notice, warning, error), `debug`-style namespacing for granular control, and support for printf-like message formatting with various placeholders (e.g., `%s`, `%d`, `%j`, `%o`). This design allows developers to write application logs once and integrate different output mechanisms without changing core logging logic. It does not expose `critical`, `alert`, or `emergency` levels, expecting these to be handled as typical exceptions. A crucial differentiator is its modular approach, requiring an explicit 'writer' package to actually emit log messages, making it highly adaptable to various runtime environments and output formats.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
While `require('log')` is shown in older documentation, ESM `import` is the recommended modern approach for better static analysis and future compatibility. Both are currently supported in Node.js environments.
The `get` method for creating namespaced loggers is an instance method of the default `log` object, not a direct named export.
To initialize the Node.js log writer, `log-node` should be imported for its side effects, typically at the entry point of your application. No specific symbol is imported, as it registers itself globally.
Demonstrates initializing the log system with `log-node`, creating default and namespaced loggers, logging at different levels, and dynamic enabling/disabling of log output.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.
No traffic data recorded yet.