http_logging 0.1.0 copy "http_logging: ^0.1.0" to clipboard
http_logging: ^0.1.0 copied to clipboard

Dart 1 only

A HTTP client middleware which logs request and response data.

http_logging #

A HTTP client middleware which logs request and response data.

Build Status

import 'dart:async';

import 'package:http/http.dart';
import 'package:http_logging/http_logging.dart';

Future<Null> main() async {
  Client loggingClient = new LoggingClient(
      // Wrap a Client to log all its requests and responses.
      new Client(),
      // Select the log level between basic (default), headers, and body.
      level: LoggingLevel.body,
      // Pass in a logger, by default it uses the print method.
      logger: (msg) => print("HTTP: $msg"));

  await loggingClient.read('https://www.dartlang.org/');
}

It's highly inspired by the OkHTTP logging interceptor.

0
likes
30
pub points
17%
popularity

Publisher

unverified uploader

A HTTP client middleware which logs request and response data.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

http, http_parser

More

Packages that depend on http_logging