snug_logger 1.0.8 snug_logger: ^1.0.8 copied to clipboard
Snug Logger - Cozy, Fun, Powerful! Elevate your coding with simplicity and a touch of fun. Logging made delightful.
snug_logger ποΈ #
A logging package for Flutter that's as comfy as your favorite hoodie and as efficient as a well-oiled machine.
Welcome π #
Say goodbye to boring logs and hello to vibrant, colorful messages! Snug Logger makes logging a joyful dance of information. Let it add a touch of fun to your code canvas and make your development journey a lively celebration! ππ»π
Features Overview: #
1. Colorful Logging: #
- Dynamic and colorful log messages for different levels, enhancing visual debugging.
- Emoji-based log level indicators add a playful touch to logs.
2. Dynamic Log Levels: #
- Supports various log levels: debug, info, production, and error.
3. Network Request Handling: #
- Introduces
SnugDioLogger
for handling Dio network requests with detailed logging options. - Granular control over logging request headers, response headers, response data, and more.
4. Structured Log Formatting: #
- Well-organized log templates with clear sections for easy readability.
- Consistent formatting across different log levels for a professional appearance.
Installation: #
Add the snug_logger
package to your pubspec.yaml
file:
dependencies:
snug_logger: ^1.0.8
Run:
flutter pub get
Usage: #
Import the package: #
import 'package:snug_logger/snug_logger.dart';
Log Messages: #
Info Message Example:
snugLog("This is an info message, just like a good dad joke, it's informative and amusing! π¨βπ§βπ¦π€£",
logType:LogType.info);
Debug Message Example:
snugLog("This is a debug message, but don't worry, I'm debugging it with a magnifying glass, not a clown nose! π€‘π",
logType:LogType.debug);
Error Message Example:
snugLog(
"Uh-oh, something went wrong! But don\'t worry, I'm on it! π¦ΈββοΈπ§",
logType:LogType.error,
stackTrace: StackTrace.current
);
Production Message Example:
snugLog("This is a production message, like a well-crafted joke, it's ready for the big stage! ππ",
logType:LogType.production);
SnugDioLogger for Dio Network Requests: #
_dio.interceptors.add(
SnugDioLogger(
responseMessage: true,
responseData: true,
requestData: true,
responseHeaders: false,
requestHeaders: false,
logPrint: (object) {
debugPrint(object.toString());
},
),
);
Join the Snug Squad: #
Feel free to contribute, discuss, or just spread good vibes! πβ¨
If you have specific questions or optimizations you'd like me to explore in the code, please let me know! We are all here to learn and grow together. π
Why don't programmers like nature? It has too many bugs! ππΏ π