Skip to content

Commit

Permalink
Merge pull request #27 from dmakwt/master
Browse files Browse the repository at this point in the history
Support diox
  • Loading branch information
Milad-Akarie authored Feb 13, 2023
2 parents ca958df + cf3ffd1 commit 7c49d0f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 25 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
#Changelog

## [1.3.4]

- support dio >= 5.0.0

## [1.3.3]

- support diox >= 5.0.0

## [1.2.0-beta-1]
- support dio >= 4.0.0

- support dio >= 4.0.0

## [1.2.0-beta]

- migrate to nullSafety

## [1.1.1]

- remove flutter as dependency

## [1.1.0]
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# pretty_dio_logger
# pretty_diox_logger

Pretty Dio logger is a [Dio](https://pub.dev/packages/dio) interceptor that logs network calls in a pretty, easy to read format.
[![Pub](https://img.shields.io/pub/v/pretty_diox_logger.svg)](https://pub.dev/packages/pretty_diox_logger)

Pretty Dio logger is a [Dio](https://pub.dev/packages/diox) interceptor that logs network calls in a pretty, easy to read format.

> Forked from [pretty_dio_logger](https://github.com/Milad-Akarie/pretty_dio_logger) to support Dio V5
## Usage

Expand All @@ -24,9 +28,9 @@ dio.interceptors.add(PrettyDioLogger());

### VS Code

![Request Example](https://github.com/Milad-Akarie/pretty_dio_logger/blob/master/images/request_log_vscode.png?raw=true "Request Example")
![Error Example](https://github.com/Milad-Akarie/pretty_dio_logger/blob/master/images/error_log_vscode.png?raw=true "Error Example")
![Request Example](https://github.com/Milad-Akarie/pretty_dio_logger/blob/master/images/request_log_vscode.png?raw=true 'Request Example')
![Error Example](https://github.com/Milad-Akarie/pretty_dio_logger/blob/master/images/error_log_vscode.png?raw=true 'Error Example')

### Android studio

![Response Example](https://github.com/Milad-Akarie/pretty_dio_logger/blob/master/images/response_log_android_studio.png?raw=true "Response Example")
![Response Example](https://github.com/Milad-Akarie/pretty_dio_logger/blob/master/images/response_log_android_studio.png?raw=true 'Response Example')
2 changes: 1 addition & 1 deletion example/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dio/dio.dart';
import 'package:pretty_dio_logger/pretty_dio_logger.dart';
import 'package:pretty_diox_logger/pretty_diox_logger.dart';

void main() async {
final dio = Dio()
Expand Down
2 changes: 1 addition & 1 deletion lib/pretty_dio_logger.dart → lib/pretty_diox_logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class PrettyDioLogger extends Interceptor {
@override
void onError(DioError err, ErrorInterceptorHandler handler) {
if (error) {
if (err.type == DioErrorType.response) {
if (err.type == DioErrorType.badResponse) {
final uri = err.response?.requestOptions.uri;
_printBoxed(
header:
Expand Down
31 changes: 20 additions & 11 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,73 @@ packages:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
sha256: "8e36feea6de5ea69f2199f29cf42a450a855738c498b57c0b980e2d3cca9c362"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.dartlang.org"
sha256: "9fdbf71baeb250fc9da847f6cb2052196f62c19906a3657adfc18631a667d316"
url: "https://pub.dev"
source: hosted
version: "4.0.0-prev1"
version: "5.0.0"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185
url: "https://pub.dev"
source: hosted
version: "4.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
sha256: d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a
url: "https://pub.dev"
source: hosted
version: "1.8.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4
url: "https://pub.dev"
source: hosted
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830
url: "https://pub.dev"
source: hosted
version: "1.2.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.18.6 <3.0.0"
12 changes: 6 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: pretty_dio_logger
description: Pretty Dio logger is a Dio interceptor that logs network calls in a pretty, easy to read format.
version: 1.2.0-beta-1
homepage: https://github.com/Milad-Akarie/pretty_dio_logger
name: pretty_diox_logger
description: Pretty Diox logger is a Diox interceptor that logs network calls in a pretty, easy to read format.
version: 1.3.4
homepage: https://github.com/dmakwt/pretty_diox_logger

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: '>=2.18.6 <3.0.0'

dependencies:
dio: ">=4.0.0-prev1 <=5.0.0"
dio: ^5.0.0

0 comments on commit 7c49d0f

Please sign in to comment.