diff --git a/.dart_tool/version b/.dart_tool/version index 13d683c..b44c537 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.0.1 \ No newline at end of file +3.7.12 \ No newline at end of file diff --git a/android/local.properties b/android/local.properties new file mode 100644 index 0000000..7cc4608 --- /dev/null +++ b/android/local.properties @@ -0,0 +1,2 @@ +sdk.dir=/Users/mingo/Library/Android/sdk +flutter.sdk=/Users/mingo/Downloads/flutter \ No newline at end of file diff --git a/lib/interceptor/dio_log_interceptor.dart b/lib/interceptor/dio_log_interceptor.dart index 1e1c230..998e6fe 100644 --- a/lib/interceptor/dio_log_interceptor.dart +++ b/lib/interceptor/dio_log_interceptor.dart @@ -3,6 +3,8 @@ import 'package:dio_log/bean/err_options.dart'; import 'package:dio_log/bean/net_options.dart'; import 'package:dio_log/bean/req_options.dart'; import 'package:dio_log/bean/res_options.dart'; +// import 'package:flutter/material.dart' show debugPrint; +import 'dart:developer'; import '../dio_log.dart'; @@ -62,14 +64,14 @@ class DioLogInterceptor implements Interceptor { resOpt.headers = response.headers.map; logManage?.onResponse(resOpt); if (enablePrintLog) { - NetOptions log = - LogPoolManager.getInstance().logMap[resOpt.id.toString()]!; - print('dio_log: request: url:${log.reqOptions?.url}'); - print('dio_log: request: method:${log.reqOptions?.method}'); - print('dio_log: request: params:${log.reqOptions?.params}'); - print( - 'dio_log: request: duration:${getTimeStr1(log.reqOptions!.requestTime!)}'); - print('dio_log: response: ${toJson(log.resOptions?.data)}'); + NetOptions opt = LogPoolManager.getInstance().logMap[resOpt.id.toString()]!; + log('dio_log_request: duration:${getTimeStr1(opt.reqOptions!.requestTime!)}'); + log('dio_log_request: url:${opt.reqOptions?.url}'); + log('dio_log_request: method:${opt.reqOptions?.method}'); + log('dio_log_request: headers:${opt.reqOptions?.headers}'); + log('dio_log_request: params:${opt.reqOptions?.params}'); + log('dio_log_request: data:${opt.reqOptions?.data}'); + log('dio_log_response: ${toJson(opt.resOptions?.data)}'); } } } diff --git a/pubspec.yaml b/pubspec.yaml index 7ea3068..0fa89d4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,7 +9,7 @@ environment: dependencies: flutter: sdk: flutter - dio: ^4.0.0 + dio: any dev_dependencies: flutter_test: