rainbow_logger 0.0.1
rainbow_logger: ^0.0.1 copied to clipboard
A colorful and expressive Flutter logger for terminal/debug output with emoji prefixes and ANSI color codes.
๐ 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 logginglib/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.