JetLeaf Logging

License

A powerful, extensible logging library for Dart applications that provides flexible logging capabilities with support for ANSI colors, custom formatting, and multiple output formats.

Features

  • 🎨 ANSI Color Support: Beautiful, color-coded output for better log readability
  • πŸ–¨οΈ Multiple Printer Types: Choose from various log printers (simple, pretty, flat, structured, etc.)
  • πŸ“Š Log Levels: Built-in support for different log levels (debug, info, warning, error, etc.)
  • 🧩 Extensible: Easily create custom log printers and formatters
  • πŸ—οΈ Structured Logging: Support for structured logging with metadata
  • πŸ” Stack Trace Parsing: Built-in stack trace parsing for better debugging
  • ⚑ High Performance: Optimized for performance in production environments

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  jetleaf_logging: ^1.0.0

Quick Start

import 'package:jetleaf_logging/jetleaf_logging.dart';

void main() {
  // Create a logger
  final logger = Logger();
  
  // Log messages at different levels
  logger.d('Debug message');
  logger.i('Info message');
  logger.w('Warning message');
  logger.e('Error message', error: 'Something went wrong');
  
  // Log with custom printer
  final prettyPrinter = PrettyPrinter(
    colors: true,
    printEmojis: true,
  );
  
  logger.d('This will be pretty printed', printer: prettyPrinter);
}

Documentation

For detailed documentation, see the docs directory.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed with ❀️ by the JetLeaf Team

Libraries

logging
A flexible and extensible structured logging library for Dart and Flutter.
printers
This library provides a set of log printers that can be used to format log records into a string representation.