restore log on ui teardown (#3427)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman 2024-11-08 12:31:38 -05:00 committed by GitHub
parent 3c070e0ad9
commit b0bffef1a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,6 +78,13 @@ func (m *UI) Handle(e partybus.Event) error {
} }
func (m *UI) Teardown(force bool) 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 { if !force {
m.handler.Wait() m.handler.Wait()
m.program.Quit() m.program.Quit()