๐ŸŒˆ RainbowLogger

RainbowLogger is a colorful and expressive logger for Flutter and Dart apps.
It adds clarity and visual appeal to your console output using emoji, colors, and timestamps โ€” perfect for stylish and structured debugging!


โœจ Features

  • โœ… Predefined log types: error, success, info, warning, log
  • ๐ŸŽจ ANSI terminal coloring mapped from Flutter Colors
  • ๐Ÿ•’ Optional timestamps for better log tracing
  • ๐Ÿงฉ Custom prefix, suffix, and color
  • ๐Ÿ” Reusable logger instances with configurable settings
  • ๐Ÿ’ป Works with both Flutter and pure Dart CLI apps

๐Ÿš€ Installation

Add to your pubspec.yaml:

dependencies:
  rainbow_logger: ^1.0.0

Then run:

flutter pub get

๐Ÿ“ฆ Import

import 'package:rainbow_logger/rainbow_logger.dart';

๐Ÿงช Usage

๐Ÿ”น Quick Static Logging

RainbowLogger.errorPrint("Something went wrong!");
RainbowLogger.successPrint("Operation completed successfully.");
RainbowLogger.infoPrint("User has entered the dashboard.");
RainbowLogger.warningPrint("This is just a warning.");
RainbowLogger.logPrint("Custom colored log",color: Colors.purple,prefix: "๐Ÿ’ก",suffix: "โœ”๏ธ",showTimestamp:true,);

๐Ÿ”ธ Reusable Logger Instance

final logger = RainbowLogger(prefix: "๐Ÿš€",suffix: "โœ…",color: Colors.cyan,showTimestamp: true,);
logger.print("Reusable logger in action!");

๐Ÿ“˜ Output Example (Styled)

[12:00:01] โŒ Something went wrong!
[12:00:01] โœ… Operation completed successfully.
[12:00:01] โ„น๏ธ User has entered the dashboard.
[12:00:01] โš ๏ธ This is just a warning.
[12:00:01] ๐Ÿ’ก Custom colored log โœ”๏ธ
[12:00:01] ๐Ÿš€ Reusable logger in action! โœ…

โœ… Note: ANSI colors appear correctly in terminals and IDE consoles like VS Code, IntelliJ, or Android Studio.


๐Ÿ“ File Structure

  • lib/rainbow_logger.dart โ€“ Core logger class with static and instance logging
  • lib/rainbow_colors.dart โ€“ Helper class for color-to-ANSI mapping

๐Ÿง  Why Use RainbowLogger?

  • Easier debugging with structured and colorful logs
  • Visual cues for better log scanning and error detection
  • Simple to use and lightweight
  • Fully customizable with emoji, colors, and timestamps

๐Ÿ“„ License

MIT License ยฉ 2025 Piyush Kumar


๐Ÿ’ก Contributions

Pull requests are welcome!
Feel free to open issues or suggest improvements.


Libraries

rainbow_logger