refactor(client): 抽统一日志函数 logLine + 去掉重复时间戳
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled

- 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:
wangjia
2026-06-18 22:17:09 +08:00
parent 3a20a40101
commit b9e5dbec9b
4 changed files with 33 additions and 16 deletions
+2 -2
View File
@@ -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);
}