diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b7bbb4..979cb00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # 更新日志 +3.0.1 -2025-04-08 +--- +- CHANGE: 加入`memLimit`指示gc +- CHANGE: 加入`hlog`输出路径配置 +- CHANGE: 修正H2C配置问题 + 25w27a - 2025-04-07 --- - PRE-RELEASE: 此版本是v3.0.1的预发布版本,请勿在生产环境中使用; diff --git a/VERSION b/VERSION index 56fea8a..13d683c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 \ No newline at end of file +3.0.1 \ No newline at end of file diff --git a/main.go b/main.go index c59293b..cd21df2 100644 --- a/main.go +++ b/main.go @@ -141,11 +141,11 @@ func setupHertZLogger(cfg *config.Config) { if cfg.Log.HertZLogPath != "" { hertZfile, err = os.OpenFile(cfg.Log.HertZLogPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) if err != nil { - fmt.Printf("Failed to open log file: %v\n", err) - os.Exit(1) + hlog.SetOutput(os.Stdout) + logWarning("Failed to open hertz log file: %v", err) + } else { + hlog.SetOutput(hertZfile) } - - hlog.SetOutput(hertZfile) } } @@ -446,6 +446,13 @@ func main() { r.Spin() defer logger.Close() - defer hertZfile.Close() + defer func() { + if hertZfile != nil { + err := hertZfile.Close() + if err != nil { + logError("Failed to close hertz log file: %v", err) + } + } + }() fmt.Println("Program Exit") }