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 classificationLogStepโ lifecycle phases (e.g., start/end)LogTypeโ categorization of log intent
๐จ ANSI Output
AnsiColorโ terminal-safe color/style definitionsAnsiOutputโ utilities for rendering styled log text
Useful for rich console diagnostics.
๐ Log Models
LogConfigโ runtime configuration for logging behaviorLogRecordโ immutable representation of a logged event
Enables structured logging and external routing.
โ๏ธ Core Logging Engine
LogPrinterโ strategy interface for rendering logsLoggingListenerโ event subscription for log emissionLogFactoryโ responsible for creating log instancesLogโ 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
LogRecordrepresents a single logging event captured by the logging system.