File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
components/supervisor/cmd Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ var initCmd = &cobra.Command{
140140 select {
141141 case <- supervisorDone :
142142 // supervisor has ended - we're all done here
143+ defer log .Info ("supervisor has ended (supervisorDone)" )
143144 return
144145 case <- sigInput :
145146 ignoreUnexpectedExitCode .Store (true )
@@ -161,7 +162,9 @@ var initCmd = &cobra.Command{
161162 case <- ctx .Done ():
162163 // Time is up, but we give all the goroutines a bit more time to react to this.
163164 time .Sleep (time .Millisecond * 500 )
165+ defer log .Info ("supervisor has ended (ctx.Done)" )
164166 case <- terminationDone :
167+ defer log .Info ("supervisor has ended (terminationDone)" )
165168 }
166169 slog .write ("Finished shutting down all processes." )
167170 }
@@ -229,10 +232,12 @@ type shutdownLoggerImpl struct {
229232
230233func (l * shutdownLoggerImpl ) write (s string ) {
231234 if l .file != nil {
232- _ , err := l .file .WriteString (fmt .Sprintf ("[%s] %s \n " , time .Since (l .startTime ), s ))
235+ msg := fmt .Sprintf ("[%s] %s \n " , time .Since (l .startTime ), s )
236+ _ , err := l .file .WriteString (msg )
233237 if err != nil {
234238 log .WithError (err ).Error ("couldn't write to log file" )
235239 }
240+ log .Infof ("slog: %s" , msg )
236241 } else {
237242 log .Debug (s )
238243 }
You can’t perform that action at this time.
0 commit comments