http_logger_plus 1.0.0 copy "http_logger_plus: ^1.0.0" to clipboard
http_logger_plus: ^1.0.0 copied to clipboard

A developer-friendly HTTP logger for Dart and Flutter that wraps http.Client and logs all requests and responses with cURL generation, pretty formatting, and color-coded output.

๐Ÿงพ http_logger_plus #

A developer-friendly HTTP logger for Dart that wraps http.Client and logs all requests and responses with formatting, cURL command generation, color-coded CLI output, and more.

๐Ÿ” Perfect for debugging APIs, inspecting outgoing requests, and logging backend interactions in both CLI tools and Flutter apps.


pub version Dart CI License: MIT


โœจ Features #

  • โœ… Drop-in replacement for http.Client
  • ๐Ÿงพ Pretty-printed request & response logs
  • ๐ŸŽจ Color-coded terminal output
  • ๐ŸŒ€ cURL command generation for any request
  • ๐Ÿงผ Truncated body logging for large payloads
  • ๐Ÿ” Easy to extend with custom filters (coming soon)

๐Ÿš€ Getting started #

Add the dependency to your pubspec.yaml:

dependencies:
  http_logger_plus: ^0.0.1

๐Ÿ“ฆ Usage #

void main() async {
  final client = HttpLoggerClient(http.Client());

  final response = await client.post(
    Uri.parse("https://jsonplaceholder.typicode.com/posts"),
    headers: {"Content-Type": "application/json; charset=utf-8"},
    body: '{"title": "test", "body": "content", "userId": 1}',
  );

  print("Actual response: ${response.body}");
}

๐Ÿงช Example Log Output #

๐ŸŸฆ [POST] https://jsonplaceholder.typicode.com/posts
Headers:
  Content-Type: application/json; charset=utf-8

๐Ÿ’ก curl -X POST "https://jsonplaceholder.typicode.com/posts" -H "Content-Type: application/json; charset=utf-8" -d '{"title": "test", "body": "content", "userId": 1}'

๐Ÿ“ค Request Body:
{
  "title": "test",
  "body": "content",
  "userId": 1
}

โฌ‡๏ธ Response [201 Created] (407ms)
Response Body:
{
  "title": "test",
  "body": "content",
  "userId": 1,
  "id": 101
}

๐Ÿ“‚ Example #

You can find a complete example in the example/ directory.


๐Ÿ“œ License #

MIT License ยฉ 2025 Ayushman Pal

1
likes
150
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A developer-friendly HTTP logger for Dart and Flutter that wraps http.Client and logs all requests and responses with cURL generation, pretty formatting, and color-coded output.

Repository (GitHub)
View/report issues

Topics

#http #logging #developer-tools #curl #debug

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on http_logger_plus