snug_logger 1.0.6 snug_logger: ^1.0.6 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.6
Run:
flutter pub get
Usage: #
Import the package: #
import 'package:snug_logger/snug_logger.dart';
Log Messages: #
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.debug);
Production Message Example:
snugLog("This is a production message, like a well-crafted joke, it's ready for the big stage! ๐ญ๐", LogType.debug);
Info Message Example:
snugLog("This is an info message, just like a good dad joke, it's informative and amusing! ๐จโ๐งโ๐ฆ๐คฃ", LogType.debug);
SnugDioLogger for Dio Network Requests: #
Dio _dio = Dio();
_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! ๐๐ฟ ๐