diff --git a/cmd/syft/internal/ui/ui.go b/cmd/syft/internal/ui/ui.go index 85fb137e95a..6af388eccec 100644 --- a/cmd/syft/internal/ui/ui.go +++ b/cmd/syft/internal/ui/ui.go @@ -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()