From 37aca6bec0837e89e87c18c7926b5bce48439fc0 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 12 Apr 2023 21:37:37 +0200 Subject: [PATCH 1/2] Add warnings via Warnf to the debug log --- cmd/restic/global.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 32f18a67f..a45ced8e8 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -282,6 +282,7 @@ func Warnf(format string, args ...interface{}) { if err != nil { fmt.Fprintf(os.Stderr, "unable to write to stderr: %v\n", err) } + debug.Log(format, args...) } // resolvePassword determines the password to be used for opening the repository. From e604939e72e84e470b146015614468790b6df672 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 12 Apr 2023 21:58:29 +0200 Subject: [PATCH 2/2] Debug log status code if execution is interrupted Currently, there is no clear indication in the debug log whether restic exited or not. --- cmd/restic/cleanup.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/restic/cleanup.go b/cmd/restic/cleanup.go index 61af72802..967957106 100644 --- a/cmd/restic/cleanup.go +++ b/cmd/restic/cleanup.go @@ -78,5 +78,6 @@ func CleanupHandler(c <-chan os.Signal) { // given exit code. func Exit(code int) { code = RunCleanupHandlers(code) + debug.Log("exiting with status code %d", code) os.Exit(code) }