-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(output): cache lipgloss renderers (#52)
* fix(output): cache lipgloss renderers Cache and reuse lipgloss renderers to avoid concurrently querying the terminal for background colors. Lipgloss HasDarkBackground function queries the terminal for the background color. Creating multiple logger instances with the same output will query the output multiple times causing Log to hange and/or freeze. To solve this, we store and retrieve the Lipgloss renderer in a global sync.Map for each output along with caching the background/foreground colors of the underlying Termenv Output. Fixes: #50 * Update logger.go Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> --------- Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
- Loading branch information
1 parent
c9ffb27
commit 6e534d0
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters