feat(client): 桌面端日志加本地时间戳前缀 [HH:MM:SS.mmm]
新增 log_time.dart(共享 logTime() helper),DesktopKernel / DesktopVpnBridge 所有日志行首打 [时:分:秒.毫秒],便于排查连接时序。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// log_time.dart — 桌面端日志统一时间戳前缀。
|
||||
// 返回本地时间 "[HH:MM:SS.mmm] ",拼在日志行首便于排查时序。
|
||||
|
||||
String logTime() {
|
||||
final n = DateTime.now();
|
||||
String p(int v, [int w = 2]) => v.toString().padLeft(w, '0');
|
||||
return '[${p(n.hour)}:${p(n.minute)}:${p(n.second)}.${p(n.millisecond, 3)}] ';
|
||||
}
|
||||
Reference in New Issue
Block a user