log_er 2.0.2
log_er: ^2.0.2 copied to clipboard
Log_er - Powerful & Colorful Logging for Flutter
π Log_er - Powerful & Colorful Logging for Flutter π #
π Overview #
Log_er is a powerful, visually appealing, and easy-to-use logging package for Flutter and Dart applications.
It provides structured log output, emoji-based categories, and JSON formatting with color-coded messages.
π― Key Features #
β
Color-coded logs for easy debugging
β
Supports multiple log levels (debug, info, warn, error, fatal, special, data, json)
β
Emoji-enhanced logs for better visibility
β
JSON pretty-printing with auto-formatting
β
StackTrace support for debugging errors
β
Text wrapping at 80 characters for readability
β
Custom log messages with any emoji and color
β
Log messages enclosed in * for clarity
π¦ Installation #
To install Log_er, add the package to your pubspec.yaml file:
dependencies:
log_er: ^2.0.1+1
flutter pub get
import 'package:log_er/log_er.dart';
void main() {
Log.debug(" Debug message: Used for development testing.");
Log.info("βΉ Info message: General system information.");
Log.warning(" Warning: Something might need attention.");
Log.error(" Error: A critical issue occurred!");
Log.special(" Special log event.");
Log.data(" Data successfully processed.");
}
**********************************
* π [DEBUG] Debug message: Used for development testing. *
**********************************
**********************************
* π΅ [INFO] βΉοΈ Info message: General system information. *
**********************************
**********************************
* β οΈ [WARNING] π¨ Warning: Something might need attention. *
**********************************
**********************************
* π₯ [ERROR] π₯ Error: A critical issue occurred! *
**********************************
**********************************
* π [FATAL] π Fatal error! System crash. *
**********************************
**********************************
* π [SPECIAL] π Special log event. *
**********************************
**********************************
* π [DATA] π Data successfully processed. *
**********************************
void main() {
String jsonString = '''
{
"user": {
"name": "Alice",
"age": 25,
"contact": {
"email": "alice@example.com",
"phone": "+123456789"
},
"bio": "Software Engineer. Loves AI."
}
}
''';
Log.json(jsonString);
}
**********************************
* π [JSON]
{
"user":
{
"name": "Alice",
"age": 25,
"contact":
{
"email": "alice@example.com",
"phone": "+123456789"
},
"bio": "Software Engineer. Loves AI."
}
} *
**********************************
void main() {
try {
throw Exception("Something went wrong!");
} catch (e, stackTrace) {
Log.error("π₯ Critical Error: $e", stackTrace: stackTrace);
}
}
**********************************
* π₯ [ERROR] Critical Error: Exception: Something went wrong! *
**********************************
#0 main (file://...)
#1 _runMain (dart:...)
...
π Why is this useful?
Captures and logs stack traces automatically
Helps track where the error occurred for easier debugging
β
4οΈβ£ Custom Logs with Emojis and Colors
dart
Kopyala
DΓΌzenle
void main() {
Log.log("β¨", "CUSTOM", "This is a custom log!", color: '\x1B[35m');
Log.log("π", "SYSTEM", "System started successfully.", color: '\x1B[32m');
}
πΉ Expected Output
markdown
Kopyala
DΓΌzenle
**********************************
* β¨ [CUSTOM] This is a custom log! *
**********************************
**********************************
* π [SYSTEM] System started successfully. *
**********************************
π Why is this useful?
Define your own log categories
Customize with unique emojis and colors
β
5οΈβ£ Long Message Wrapping for Readability
dart
Kopyala
DΓΌzenle
void main() {
String longMessage = "π This is a very long log message that contains a lot of text. "
"It is used to test how the logging system handles large messages "
"and ensures that the text wraps properly instead of overflowing the screen.";
Log.info(longMessage);
}
πΉ Expected Output (wrapped at 80 characters)
markdown
Kopyala
DΓΌzenle
**********************************
* π΅ [INFO] π This is a very long log message that contains a lot of text. *
It is used to test how the logging system handles large messages
and ensures that the text wraps properly instead of overflowing the screen.
**********************************
π Why is this useful?
Ensures long messages do not break formatting
Automatically wraps text to improve readability
π― Comparison with Other Logging Packages
Feature log_er logger dart:developer
Emoji-based logs β
Yes β No β No
Color-coded logs β
Yes β
Yes β No
JSON auto-formatting β
Yes β No β No
StackTrace support β
Yes β
Yes β
Yes
Custom log categories β
Yes β No β No
Bordered log formatting β
Yes β No β No
π License
Log_er is released under the MIT License. You are free to use, modify, and distribute this package.
π Final Thoughts
β
Visually appealing logs with emojis & colors
β
Pretty JSON logging with auto-formatting
β
Handles errors and stack traces automatically
β
Supports long text wrapping for better readability
β
Custom log messages with any emoji and color
π Your logging is now clean, structured, and beautiful! π
If you have any questions or feature requests, feel free to ask! π
yaml
Kopyala
DΓΌzenle
---
### **π Why This `README.md` is Effective**
β
**Includes all key features with explanations**
β
**Uses emojis and formatting for better readability**
β
**Provides detailed usage examples with expected output**
β
**Comparison table shows why `log_er` is better**
β
**Makes the package look professional and user-friendly**
π **Your package now has a polished, professional, and visually engaging `README.md`!** π
Let me know if you need any further improvements! π