printers library
π¨οΈ JetLeaf Logging Printers
This library exposes all built-in printer implementations used by the JetLeaf logging system to format and render log output.
Printers control how logs are displayed, whether in human-readable, compact, or structured formats. They can be combined, customized, or replaced with custom implementations.
π¨ Available Printers
π Flat Output
FlatPrinterβ minimal single-line outputFlatStructuredPrinterβ flat formatting with structured fields
Ideal for CLI tools and compact logs.
π§Ύ Formatted Output
FmtPrinterβ template-driven formatting (printf-style)
Useful when enforcing consistent patterns.
π Hybrid Output
HybridPrinterβ mixes pretty and structured formatting based on context
Great when balancing human readability and machine parsing.
π· Prefixing Support
PrefixPrinterβ adds prefixes (categories, timestamps, thread IDs, etc.)
Can wrap other printers to extend behavior.
π Pretty Output
PrettyPrinterβ colorized, multi-line, developer-friendly formattingPrettyStructuredPrinterβ pretty formatting with structured metadata
Ideal for debugging and local development.
β Simple Output
SimplePrinterβ lightweight text output without styling
Good for environments with limited terminal capabilities.
π― Intended Usage
Import to configure logging behavior:
import 'package:jetleaf_logging/printers.dart';
final printer = PrettyPrinter();
Printers are typically assigned through LogConfig or LogFactory.
Β© 2025 Hapnium & JetLeaf Contributors
Classes
- FlatPrinter
- A simple, flat-style log printer that outputs log records in a structured format.
- FlatStructuredPrinter
- A structured log printer that formats log records with optional indentation and stack traces.
- FmtPrinter
- A log printer that outputs logs in logfmt format.
- HybridPrinter
- A hybrid log printer that delegates printing based on log level.
- PrefixPrinter
- A customizable log printer that prepends a prefix to each log line.
- PrettyPrinter
- A visually styled log printer that wraps log output in a clean box format.
- PrettyStructuredPrinter
- A structured and visually aligned log printer designed for clear readability.
- SimplePrinter
- Simple printer that outputs basic, compact log messages in a single line.