Skip to content

Commit

Permalink
Update logger.go
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
aymanbagabas and caarlos0 committed Mar 21, 2023
1 parent 01f932d commit 023bb73
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ func (l *Logger) SetOutput(w io.Writer) {
}
atomic.StoreUint32(&l.isDiscard, isDiscard)
// Reuse cached renderers
v, ok := registry.Load(w)
if !ok {
v = lipgloss.NewRenderer(w, termenv.WithColorCache(true))
registry.Store(w, v)
if v, ok := registry.Load(w); ok {
l.re = v.(*lipgloss.Renderer)
} else {
l.re = lipgloss.NewRenderer(w, termenv.WithColorCache(true))
registry.Store(w, l.re)
}
l.re = v.(*lipgloss.Renderer)
}

// SetFormatter sets the formatter.
Expand Down

0 comments on commit 023bb73

Please sign in to comment.