From 6548762c4c778c6e5cf68f7a7bd6fc17c4fca4d3 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Fri, 4 Sep 2020 14:00:50 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=BD=91=E6=97=A5=E5=BF=97=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/log/let_log.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/util/log/let_log.dart b/lib/util/log/let_log.dart index 5dec19b..a374b4b 100644 --- a/lib/util/log/let_log.dart +++ b/lib/util/log/let_log.dart @@ -3,6 +3,7 @@ library let_log; import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'dart:developer'; part 'log_widget.dart'; part 'net_widget.dart'; @@ -186,18 +187,19 @@ class _Log { } static void add(_Type type, Object value, Object detail) { - final log = _Log( + final logUtil = _Log( type: type, message: value?.toString(), detail: detail?.toString(), start: DateTime.now(), ); - list.add(log); + list.add(logUtil); _clearWhenTooMuch(); length.value++; if (Logger.config.printLog) { - debugPrint( - "${log.typeName} ${log.message}${log.detail == null ? '' : '\n${log.detail}'}\n--------------------------------"); +// debugPrint( +// "${logUtil.typeName} ${logUtil.message}${logUtil.detail == null ? '' : '\n${logUtil.detail}'}\n--------------------------------"); + log("\n${logUtil.typeName} ${logUtil.message}${logUtil.detail == null ? '' : '\n${logUtil.detail}'}\n--------------------------------"); } } @@ -318,8 +320,7 @@ class _Net extends ChangeNotifier { _clearWhenTooMuch(); length.value++; if (Logger.config.printNet) { - debugPrint( - "${_printNames[4]} ${type == null ? '' : '$type: '}${net.api}${net.req == null ? '' : '\n${_printNames[0]} 请求数据: ${net.req}'}\n--------------------------------"); + log("\n${_printNames[4]} ${type == null ? '' : '$type: '}${net.api}${net.req == null ? '' : '\n${_printNames[0]} 请求数据: ${net.req}'}\n--------------------------------"); } } @@ -349,8 +350,7 @@ class _Net extends ChangeNotifier { length.value++; } if (Logger.config.printNet) { - debugPrint( - "${_printNames[5]} ${net.type == null ? '' : '${net.type}: '}${net.api}${net.res == null ? '' : '\n${_printNames[0]} 响应数据: ${net.res}'}\nSpend: ${net.spend} ms\n--------------------------------"); + log("\n${_printNames[5]} ${net.type == null ? '' : '${net.type}: '}${net.api}${net.res == null ? '' : '\n${_printNames[0]} 响应数据: ${net.res}'}\nSpend: ${net.spend} ms\n--------------------------------"); } }