logging library

πŸ“ JetLeaf Logging System

This library provides the core logging infrastructure for the JetLeaf framework, including log levels, formatting, configuration models, output handling, and extensible logging pipelines.

It serves as the public entry point to JetLeaf's logging API.

πŸ”₯ Key Features

  • Flexible log level control (trace β†’ fatal)
  • ANSI-styled console output
  • Structured log records
  • Configurable printers and listeners
  • Extensible logging factory and entrypoints

πŸ“¦ Exports Overview

🧾 Log Enums

  • LogLevel β€” severity classification
  • LogStep β€” lifecycle phases (e.g., start/end)
  • LogType β€” categorization of log intent

🎨 ANSI Output

  • AnsiColor β€” terminal-safe color/style definitions
  • AnsiOutput β€” utilities for rendering styled log text

Useful for rich console diagnostics.

πŸ“‘ Log Models

  • LogConfig β€” runtime configuration for logging behavior
  • LogRecord β€” immutable representation of a logged event

Enables structured logging and external routing.

βš™οΈ Core Logging Engine

  • LogPrinter β€” strategy interface for rendering logs
  • LoggingListener β€” event subscription for log emission
  • LogFactory β€” responsible for creating log instances
  • Log β€” primary logging API entrypoint

Example usage:

final log = LogFactory.get('server');
log.info('Server started');

πŸ›  Helpers

  • common utility functions supporting the logging system

βœ… Intended Usage

Import once to access the complete JetLeaf logging API:

import 'package:jetleaf_logging/logging.dart';

Designed for framework and application-level diagnostics, with extensibility for custom sinks, printers, and integrations.

Classes

AnsiColor
A utility class to apply ANSI terminal color codes to strings.
AnsiOutput
A utility class for formatting terminal output using ANSI colors and background styles.
DefaultLoggingListener
A default implementation of LoggingListener that outputs logs to the console.
Log
A convenient logging utility built on top of LogFactory.
LogCommons
A utility class that provides common styling and symbols for different LogLevels.
LogConfig
Configuration class that controls the appearance and content of log output.
LogFactory
A base class for building structured logging mechanisms within Jet-based applications.
Logger
A flexible and extensible logging interface.
LoggingListener
A listener interface for reacting to logging events within an application.
LogPrinter
A base class for implementing custom log output formatting.
LogProperties
A small, thread-safe global registry for logging configuration and diagnostic properties within Jetleaf.
LogRecord
A LogRecord represents a single logging event captured by the logging system.

Enums

LogLevel
Defines various levels of logging severity for controlling logging output.
LogStep
Defines individual components (steps) that can be included in log output.
LogType
Specifies the overall formatting strategy used for log output.

Properties

console β†’ Logger
Global singleton logger instance for convenience.
final