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
170
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