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.