refactor(client): 抽统一日志函数 logLine + 去掉重复时间戳
- log_time.dart → log.dart:提供 logLine(tag, msg),格式 `[时:分:秒.毫秒] [tag] msg`, DesktopKernel / DesktopVpnBridge 散落的 print+拼接全部收敛到此。 - 下发配置 log.timestamp=false:sing-box 不再自带时间戳,避免一行打印两个时间 (之前 `[22:10:35.213] [stderr] +0800 2026-06-18 22:10:35 ...` 重复)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ import 'dart:math' as math;
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'log_time.dart';
|
||||
import 'log.dart';
|
||||
import 'vpn_bridge.dart';
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════
|
||||
@@ -482,7 +482,7 @@ class DesktopKernelProcess implements KernelProcess {
|
||||
}
|
||||
|
||||
void _log(String msg) {
|
||||
print('${logTime()}[DesktopKernel] $msg');
|
||||
logLine('DesktopKernel', msg);
|
||||
if (!_logCtrl.isClosed) _logCtrl.add(msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user