Exframe Logger is a foundational logging module designed for the Harmony Framework, built on top of the popular Winston logging library. It provides a structured approach to application-level logging, offering standard log levels such as `debug`, `info`, `warn`, and `error`. Currently at version 3.8.7, the package generally follows a stable release cadence with patch updates for bug fixes and minor improvements. Its key differentiator is its integration within the Exframe ecosystem, providing a consistent logging experience for applications leveraging other Exframe modules. Developers looking for a robust, Winston-backed logger within a structured framework context will find it suitable, though it can also be used standalone. It ships with TypeScript types, promoting better developer experience and type safety.
npm install exframe-loggerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and instantiate the Exframe Logger, then log messages across various severity levels with optional metadata.
Always use `import ... from 'exframe-logger'` for ESM or `const ... = require('exframe-logger')` for CommonJS.Upgrade your Node.js runtime to version 14.0.0 or newer (e.g., using `nvm install 18` or `nvm use 18`).
Configure the logger's level during instantiation (e.g., `ExframeLogger.create({ level: 'debug' })`) or via environment variables if the library supports it, to ensure desired log levels are captured.Refer to the `exframe-logger` documentation for custom transport setup or advanced configuration options. If specific Winston features are needed directly, consider using Winston independently.
Change `require('logger')` to `require('exframe-logger')` or `import ... from 'exframe-logger'`.Ensure you are importing the default export correctly (e.g., `import ExframeLogger from 'exframe-logger'; const logger = ExframeLogger.create();`) or if `create` is a named export, use `import { create } from 'exframe-logger'; const logger = create();`.Either convert your project to use ES Modules by adding `"type": "module"` to your `package.json` and updating file extensions, or use CommonJS `require()` syntax: `const ExframeLogger = require('exframe-logger'); const logger = ExframeLogger.create();`.