Skip to content

Commit

Permalink
restore log on ui teardown (#3427)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman authored Nov 8, 2024
1 parent 3c070e0 commit b0bffef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/syft/internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ func (m *UI) Handle(e partybus.Event) error {
}

func (m *UI) Teardown(force bool) error {
defer func() {
// allow for traditional logging to resume now that the UI is shutting down
if logWrapper, ok := log.Get().(logger.Controller); ok {
logWrapper.SetOutput(m.err)
}
}()

if !force {
m.handler.Wait()
m.program.Quit()
Expand Down

0 comments on commit b0bffef

Please sign in to comment.