snug_logger
Snug Logger - Cozy, Fun, Powerful! Elevate your coding with simplicity and a touch of fun. Logging made delightful.
Use to pertify the logs in flutter application
English project snapshot. Visit GitHub for the latest content.
A colorful, structured logger for Flutter apps.
Snug Logger helps you:
debug, info, error, production)dependencies:
snug_logger: ^1.0.15
flutter pub get
import 'package:snug_logger/snug_logger.dart';
snugLog('App started', logType: LogType.info);
snugLog('Fetching user profile', logType: LogType.debug);
try {
throw Exception('Something went wrong');
} catch (error, stackTrace) {
snugLog(
error,
logType: LogType.error,
stackTrace: stackTrace,
);
}
_dio.interceptors.add(
SnugDioLogger(
requestHeaders: true,
requestData: true,
responseHeaders: true,
responseData: true,
showCurl: true,
logPrint: (object) => debugPrint(object.toString()),
),
);
When showCurl: true is enabled, Snug Logger prints reproducible cURL commands so you can quickly share failing requests with backend teams.
requestHeaders: include request headersrequestData: include request body/queryresponseHeaders: include response headersresponseData: include response bodyshowCurl: print cURL command for each requestIf you want direct control over stack trace formatting:
final formatted = StackTraceFormatter.format(stackTrace);
final terse = StackTraceFormatter.formatTerse(stackTrace);
final snug = StackTraceFormatter.formatForSnugLogger(stackTrace);
Thanks to everyone who contributed features, fixes, docs, and reviews, including the cURL printing enhancement.
Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗