Fix crash if log file can't be opened (#1937)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-03-21 18:56:13 +11:00
1 parent 9b1f8386fa
commit ad6fa3fa73
2 files changed
+14 -14

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ func serve() {
if gLogPath != "" {
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
panic(err)
log.Fatalf("failed to open log file: %s", err)
}
defer f.Close()
log.SetOutput(f)