dio_pretty_logger 2.0.0
dio_pretty_logger: ^2.0.0 copied to clipboard
A pretty-printing Dio interceptor for debugging HTTP requests and responses.
2.0.0 #
Breaking change — complete API redesign.
DioPrettyLoggeris now a properInterceptorsubclass. Add it directly:dio.interceptors.add(DioPrettyLogger()).- All configuration is now passed via constructor parameters instead of static mutable fields, making it safe to use multiple loggers with different settings.
- Removed the global
prettyInterceptorsWrappervariable. - Bug fix:
onResponsenow forwards the fullResponseobject tohandler.next(previously it incorrectly passed onlyresponse.data, breaking downstream interceptors). - Bug fix: error response body is now printed correctly in
onError. - Bug fix:
maxListPrintLengthis now respected (previously hardcoded to 2). - Bug fix: removed the always-true
i >= 0condition in_printBlock. - Added JSON string auto-detection — string bodies that contain valid JSON are decoded and pretty-printed.
- Fixed typo:
kDioLogenable→enabled. - Renamed
showErrorMsg→showError. - Updated flutter constraint to
>=3.27.0(Flutter 3.44-compatible). - Added
dio: ^5.0.0version constraint. - Expanded test suite (request, response, error, truncation, disabled state).
1.0.4 #
- prettyMap design alter
1.0.3 #
- onRequest parameter added
1.0.2 #
- onRequest method parameter added
1.0.1 #
- Initial release.