From 3ba775d4b34479837fcf92cb1ff2a6992a88e516 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 19 Dec 2020 18:19:07 -0500 Subject: [PATCH] feat: add better logging to ps:restore output Without the logging additions, it's a bit more difficult to figure out why a ps:restore is skipping the restore of an app. --- plugins/ps/ps.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/ps/ps.go b/plugins/ps/ps.go index b6849c189..a82ca6a1a 100644 --- a/plugins/ps/ps.go +++ b/plugins/ps/ps.go @@ -99,6 +99,7 @@ func Restore(appName string) error { return fmt.Errorf("Error running pre-restore: %s", err) } + common.LogInfo1("Clearing potentially invalid proxy configuration") if err := common.PlugnTrigger("proxy-clear-config", []string{appName}...); err != nil { return fmt.Errorf("Error clearing proxy config: %s", err) } @@ -111,9 +112,11 @@ func Restore(appName string) error { b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_RESTORE"}...) restore := strings.TrimSpace(string(b[:])) if restore == "0" { + common.LogWarn(fmt.Sprintf("Skipping ps:restore for %s as DOKKU_APP_RESTORE=%s", appName, restore)) return nil } + common.LogInfo1("Starting app") return Start(appName) }