更新版本到2.0

This commit is contained in:
Alex Yang
2026-01-25 16:13:52 +08:00
parent ecbc20d89f
commit a5dc5841fb
54 changed files with 76520 additions and 2914 deletions

View File

@@ -58,7 +58,7 @@ func InitLogger(logFile, level string, maxSize, maxBackups, maxAge int, _ bool)
}
// 无论是否指定日志文件,都同时输出到标准输出
if len(outputTargets) > 0 {
if len(outputTargets) > 0 {
outputTargets = append(outputTargets, os.Stdout)
} else {
// 如果没有指定日志文件,仅使用标准输出
@@ -90,12 +90,12 @@ func Close() {
// 执行日志刷新
log.Warn("日志系统已关闭")
// 确保日志被写入磁盘
if loggerOutput, ok := log.Out.(*os.File); ok {
loggerOutput.Sync()
}
initialized = false
log = nil
}