mirror of
https://github.com/charmbracelet/gum
synced 2024-05-03 15:03:20 +02:00
fix(log): use log default colors
This commit is contained in:
parent
7bae4c8fcb
commit
504a2060b2
|
@ -59,20 +59,12 @@ func (o Options) Run() error {
|
|||
}
|
||||
|
||||
st := log.DefaultStyles()
|
||||
defaultColors := map[log.Level]lipgloss.Color{
|
||||
log.DebugLevel: lipgloss.Color("63"),
|
||||
log.InfoLevel: lipgloss.Color("86"),
|
||||
log.WarnLevel: lipgloss.Color("192"),
|
||||
log.ErrorLevel: lipgloss.Color("204"),
|
||||
log.FatalLevel: lipgloss.Color("134"),
|
||||
}
|
||||
|
||||
lvl := levelToLog[o.Level]
|
||||
lvlStyle := o.LevelStyle.ToLipgloss()
|
||||
if lvlStyle.GetForeground() == lipgloss.Color("") {
|
||||
lvlStyle = lvlStyle.Foreground(defaultColors[levelToLog[o.Level]])
|
||||
lvlStyle = lvlStyle.Foreground(st.Levels[lvl].GetForeground())
|
||||
}
|
||||
|
||||
lvl := levelToLog[o.Level]
|
||||
st.Levels[lvl] = lvlStyle.
|
||||
SetString(strings.ToUpper(lvl.String())).
|
||||
Inline(true)
|
||||
|
|
Loading…
Reference in a new issue