fix: -debug 日志文件写入失败,applyLogLevel 重建 Logger 时丢失 DebugLogFile 配置

This commit is contained in:
ZacharyZcR
2026-06-14 22:23:51 +08:00
parent 6ae37b8892
commit d7071b7b8e
+3
View File
@@ -45,6 +45,9 @@ func applyLogLevel() {
StartTime: GetGlobalState().GetStartTime(), StartTime: GetGlobalState().GetStartTime(),
LevelColors: logging.GetDefaultLevelColors(), LevelColors: logging.GetDefaultLevelColors(),
} }
if fv.Debug {
config.DebugLogFile = "fscan_debug.log"
}
newLogger := logging.NewLogger(config) newLogger := logging.NewLogger(config)
newLogger.SetCoordinatedOutput(LogWithProgress) newLogger.SetCoordinatedOutput(LogWithProgress)