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 authored Mar 21, 2023
1 parent 01f932d commit a45aa36
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ func (l *Logger) SetOutput(w io.Writer) {
atomic.StoreUint32(&l.isDiscard, isDiscard)
// Reuse cached renderers
v, ok := registry.Load(w)
if !ok {
if ok {
l.re = v.(*lipgloss.Renderer)
} else {
v = lipgloss.NewRenderer(w, termenv.WithColorCache(true))
registry.Store(w, v)
l.re = v
}
l.re = v.(*lipgloss.Renderer)
}

// SetFormatter sets the formatter.
Expand Down

0 comments on commit a45aa36

Please sign in to comment.