fix:日志写入bug
This commit is contained in:
1 parent
cdcce003b1
commit
47ad782e9a
4 files changed
+8
-4
No files matched your search
@@ -17,7 +17,7 @@ final customPrinter = PrettyPrinter(
|
||||
errorMethodCount: 1,
|
||||
colors: true,
|
||||
printEmojis: false,
|
||||
dateTimeFormat: DateTimeFormat.dateAndTime,
|
||||
printTime: true,
|
||||
);
|
||||
|
||||
class ConsoleOutput extends LogOutput {
|
||||
@@ -28,6 +28,9 @@ class ConsoleOutput extends LogOutput {
|
||||
@override
|
||||
Future<void> init() async {
|
||||
try {
|
||||
// 关闭旧的sink并创建新的
|
||||
await _sink?.flush();
|
||||
await _sink?.close();
|
||||
_filePath = await AppFileTool.getLoggerBackupPath();
|
||||
if (ObjectUtil.isNotEmpty(_filePath)) {
|
||||
_sink = File(_filePath!).openWrite(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:forui/forui.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
+2
-2
@@ -726,10 +726,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: logger
|
||||
sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1
|
||||
sha256: af05cc8714f356fd1f3888fb6741cbe9fbe25cdb6eedbab80e1a6db21047d4a4
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
version: "2.3.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ dependencies:
|
||||
# 监听网络状态
|
||||
connectivity_plus: ^6.0.3
|
||||
# 日志
|
||||
logger: ^2.3.0
|
||||
logger: 2.3.0
|
||||
# 工具类
|
||||
common_utils: ^2.1.0
|
||||
# 判断两个对象相等
|
||||
|
||||
Reference in new issue
Block a user