Skip to content

Commit b0bffef

Browse files
authored
restore log on ui teardown (#3427)
Signed-off-by: Alex Goodman <[email protected]>
1 parent 3c070e0 commit b0bffef

File tree

1 file changed

+7
-0
lines changed
  • cmd/syft/internal/ui

1 file changed

+7
-0
lines changed

cmd/syft/internal/ui/ui.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ func (m *UI) Handle(e partybus.Event) error {
7878
}
7979

8080
func (m *UI) Teardown(force bool) error {
81+
defer func() {
82+
// allow for traditional logging to resume now that the UI is shutting down
83+
if logWrapper, ok := log.Get().(logger.Controller); ok {
84+
logWrapper.SetOutput(m.err)
85+
}
86+
}()
87+
8188
if !force {
8289
m.handler.Wait()
8390
m.program.Quit()

0 commit comments

Comments
 (0)