Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
/ http_logging Public archive

[DEPRECATED] A HTTP client middleware which logs request and response data.

License

Notifications You must be signed in to change notification settings

samizerouta/http_logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

[DEPRECATED] A HTTP client middleware which logs request and response data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages