From 66a07773ab3a510c435c24bb0c26057a6663b1ff Mon Sep 17 00:00:00 2001 From: Toby Allen Date: Mon, 24 Oct 2016 20:48:36 +0100 Subject: [PATCH] Log Startup and Shutdown Commands --- startupshutdown/startupshutdown.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/startupshutdown/startupshutdown.go b/startupshutdown/startupshutdown.go index 908a4f9c..a940f138 100644 --- a/startupshutdown/startupshutdown.go +++ b/startupshutdown/startupshutdown.go @@ -1,6 +1,7 @@ package startupshutdown import ( + "log" "os" "os/exec" "strings" @@ -53,8 +54,10 @@ func registerCallback(c *caddy.Controller, registerFunc func(func() error)) erro cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if nonblock { + log.Printf("[INFO] Nonblocking Command:\"%s %s\"", command, strings.Join(args, " ")) return cmd.Start() } + log.Printf("[INFO] Blocking Command:\"%s %s\"", command, strings.Join(args, " ")) return cmd.Run() }