http_logger_library 0.12.1 copy "http_logger_library: ^0.12.1" to clipboard
http_logger_library: ^0.12.1 copied to clipboard

discontinuedreplaced by: http_interceptor

A logging middleware for Dart's http module forked from TEDConsulting/http_logger.

http_logger #

A logging middleware for Dart's http module.

Usage #

http_logger uses the http_middleware package to implement logging.

Add the http_middleware and http_logger in your project.

http_middleware: any
http_logger: any

The setup is simple. You need to create an object of HttpWithMiddleware or HttpClientWithMiddleware and add the HttpLogger middleware in it.

HttpWithMiddleware httpClient = HttpWithMiddleware.build(middlewares: [
  HttpLogger(logLevel: LogLevel.BODY),
]);

var response = await httpClient.post(
  'https://jsonplaceholder.typicode.com/posts/',
  body: jsonEncode({"test1": "THis is a test"}),
  headers: {"Content-Type": "application/json"});

There are different log levels that you can use.

LogLevel.BODY
LogLevel.HEADER
LogLevel.BASIC
LogLevel.NONE
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A logging middleware for Dart's http module forked from TEDConsulting/http_logger.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

http_middleware_library

More

Packages that depend on http_logger_library