We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a62382c commit a58a186Copy full SHA for a58a186
cmd/s2k/main.go
@@ -5,6 +5,7 @@ import (
5
"os"
6
"path/filepath"
7
"runtime"
8
+ "runtime/debug"
9
"time"
10
11
cli "github.com/urfave/cli/v2"
@@ -201,6 +202,14 @@ To see actual "active" configuration use dry-run mode.
201
202
if env.Cfg != nil && len(env.Cfg.Smtp.Dir) > 0 {
203
os.RemoveAll(env.Cfg.Smtp.Dir)
204
}
205
+ // remove empty panic log if any
206
+ if env.Cfg != nil && len(env.Cfg.Logging.FileLogger.Destination) > 0 {
207
+ debug.SetCrashOutput(nil, debug.CrashOptions{})
208
+ fname := filepath.Join(filepath.Dir(env.Cfg.Logging.FileLogger.Destination), "sync2kindle-panic.log")
209
+ if fi, err := os.Stat(fname); err == nil && fi.Size() == 0 {
210
+ os.Remove(fname)
211
+ }
212
213
if err != nil {
214
os.Exit(1)
215
0 commit comments