Compare commits
2 Commits
16cb8c7f58
...
7d1a0b82bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d1a0b82bd | |||
| eef77fa240 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
bin/
|
||||
config.yaml
|
||||
*.sqlite3
|
||||
panic.log
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"git.oblat.lv/alex/triggerssmith/api"
|
||||
application "git.oblat.lv/alex/triggerssmith/internal/app"
|
||||
@@ -89,7 +90,11 @@ var serveCmd = &cobra.Command{
|
||||
slog.Error("Failed to open panic.log", slog.Any("error", err))
|
||||
} else {
|
||||
defer f.Close()
|
||||
f.WriteString(fmt.Sprintf("Panic: %v\n", r))
|
||||
fmt.Fprintln(f, "\n--------------------------------------------------------\n")
|
||||
fmt.Fprintf(f, "Time: %s\n", time.Now().Format(time.RFC3339))
|
||||
fmt.Fprintln(f, "If this is unexpected, please report: https://git.oblat.lv/alex/triggerssmith/issues")
|
||||
fmt.Fprintln(f, "\n--------------------------------------------------------\n")
|
||||
fmt.Fprintf(f, "Panic: %v\n", r)
|
||||
f.Write(stack)
|
||||
f.WriteString("\n\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user