Exframe Logger

3.8.7 · active · verified Sun Apr 19

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.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import and instantiate the Exframe Logger, then log messages across various severity levels with optional metadata.

import ExframeLogger from 'exframe-logger';

// Create a logger instance with default configuration (or pass an object for custom options)
const logger = ExframeLogger.create();

// Log messages at different levels
logger.info('Application started successfully.');
logger.debug('Database connection string: ' + process.env.DB_CONNECTION_STRING ?? 'default_connection');
logger.warn('Potential performance bottleneck detected.', { component: 'auth-service', durationMs: 1200 });
try {
  throw new Error('Failed to process user request');
} catch (error) {
  logger.error('An unhandled error occurred.', { 
    errorMessage: error.message,
    stack: error.stack,
    userId: 'user-123'
  });
}

view raw JSON →