pretty_http_logger
1.0.5, released 2 years ago by mithunadhikari.com.np
Middleware logger for Dart's http package that prints requests and responses in a readable format.
WASM-ready
What it does
It wraps the http client with middleware support, allowing you to log request/response details, set timeouts, and customize behavior. You can also build your own middleware to modify data or handle errors.
AI-written summary of version 1.0.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need detailed logging of HTTP calls in a pure Dart project
- You want a drop‑in replacement for http with middleware capabilities without adding Flutter dependencies
Skip it when
- You require a full‑featured HTTP client with built‑in retry, caching, or advanced features
- You are already using Dio or another client that provides its own logging
Strengths
- Simple integration with the standard http package
- Supports custom middleware and request timeout
- Pure Dart, no Flutter dependency
Weaknesses
- Limited to logging and basic middleware; no advanced features like retries or caching
- Relies on http package, so switching clients requires code changes
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:pretty_http_logger/pretty_http_logger.dart';
void main() async {
final http = HttpWithMiddleware.build(middlewares: [HttpLogger(logLevel: LogLevel.BODY)]);
final response = await http.get('https://jsonplaceholder.typicode.com/posts/');
print(response.body);
}Alternatives
Packages that do the same job and could replace pretty_http_logger.