Skip to content

Commit

Permalink
docs: fix styles example (#92)
Browse files Browse the repository at this point in the history
Fixes: #92
  • Loading branch information
aymanbagabas committed Nov 27, 2023
1 parent b7f36a8 commit 595fffe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/styles/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
)

func main() {
log.ErrorLevelStyle = lipgloss.NewStyle().
// Set up our custom styles
styles := log.DefaultStyles()
styles.Levels[log.ErrorLevel] = lipgloss.NewStyle().
SetString("ERROR!!").
Padding(0, 1, 0, 1).
Background(lipgloss.AdaptiveColor{
Light: "203",
Dark: "204",
}).
Background(lipgloss.Color("204")).
Foreground(lipgloss.Color("0"))
log.KeyStyles["err"] = lipgloss.NewStyle().Foreground(lipgloss.Color("204"))
log.ValueStyles["err"] = lipgloss.NewStyle().Bold(true)
styles.Keys["err"] = lipgloss.NewStyle().Foreground(lipgloss.Color("204"))
styles.Values["err"] = lipgloss.NewStyle().Bold(true)
logger := log.New(os.Stderr)
logger.SetStyles(styles)
logger.Error("Whoops!", "err", "kitchen on fire")
time.Sleep(3 * time.Second)
}

0 comments on commit 595fffe

Please sign in to comment.