rainbow_logger 0.0.2 copy "rainbow_logger: ^0.0.2" to clipboard
rainbow_logger: ^0.0.2 copied to clipboard

A colorful and expressive Flutter logger for terminal/debug output with emoji prefixes and ANSI color codes.

🌈 RainbowLogger #

Pub Version GitHub Repo stars License: MIT

RainbowLogger is a vibrant and expressive logger for Flutter and Dart CLI applications.
It enhances your debugging experience with visually distinct logs using emoji, colors, timestamps, and customization.


✨ Features #

  • βœ… Predefined log types: error, success, info, warning, log
  • 🎨 ANSI terminal coloring mapped from Flutter Colors
  • πŸ•’ Optional timestamps for clear traceability
  • πŸ’¬ Emoji-based log labeling for instant recognition
  • 🧩 Customizable prefix, suffix, and color
  • πŸ” Reusable logger instances for consistent usage across files
  • πŸ’» Works seamlessly in Flutter, Dart CLI, VS Code, Android Studio, and IntelliJ

πŸš€ Getting Started #

πŸ“¦ Installation #

Add the dependency to your pubspec.yaml:

dependencies:
  rainbow_logger: ^1.0.0

Then run:

flutter pub get

πŸ”Œ Import It #

import 'package:rainbow_logger/rainbow_logger.dart';

πŸ§ͺ Usage #

πŸ”Ή Static Logging #

Use predefined static methods for quick 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 #

Create a custom logger with consistent behavior:

final logger = RainbowLogger(
  prefix: "πŸš€",
  suffix: "βœ…",
  color: Colors.cyan,
  showTimestamp: true,
);

logger.print("Reusable logger in action!");

🎯 Output Example #

[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 terminal colors render correctly in popular editors and consoles.


πŸ“ File Structure #

rainbow_logger/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ rainbow_logger.dart        # Core logger class
β”‚   └── rainbow_colors.dart        # Color-to-ANSI mapping logic
β”œβ”€β”€ test/
β”‚   └── rainbow_logger_test.dart   # Test cases
β”œβ”€β”€ README.md                      # You're reading it
β”œβ”€β”€ CHANGELOG.md                   # Version updates
β”œβ”€β”€ LICENSE                        # MIT License
└── pubspec.yaml                   # Package metadata

🧠 Why Choose RainbowLogger? #

  • πŸ‘€ Visual Clarity: Color-coded and emoji-marked logs improve readability.
  • ⏱ Traceability: Timestamps make debugging across events much easier.
  • 🧩 Customization: Full control over how your logs appear.
  • πŸ’‘ Lightweight & Simple: No dependencies outside Flutter SDK.
  • πŸ”„ Reusable Configs: Define logger instances with consistent formats.

πŸ”— See Also #

Here are some similar or related packages you may want to explore:

  • logger – A structured logger with pretty print and trees
  • ansicolor – For terminal ANSI styling
  • chalkdart – Chainable terminal styling, inspired by JavaScript's Chalk

πŸ› οΈ Contributing #

Pull requests are warmly welcome!
You can help improve:

  • Logger output formatting
  • Color configuration logic
  • CLI utility extensions
  • Documentation enhancements

Feel free to open issues or submit PRs!


πŸ“„ License #

MIT License Β© 2025 Piyush Kumar


β˜• Support #

If you found this package helpful, consider giving it a ⭐ on GitHub!


Happy Logging! 🌈

2
likes
140
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

A colorful and expressive Flutter logger for terminal/debug output with emoji prefixes and ANSI color codes.

Repository (GitHub)
View/report issues

Topics

#logging #debug #terminal #flutter #ansi

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on rainbow_logger