change log colors

This commit is contained in:
Daylin Morgan 2024-06-21 09:51:05 -05:00
parent 4230aa175a
commit 53efc5e18c
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -54,8 +54,15 @@ var rootCmd = &cobra.Command{
func setupLogger() {
log.SetReportTimestamp(false)
styles := log.DefaultStyles()
for k, v := range styles.Levels {
styles.Levels[k] = v.Width(5).MaxWidth(5)
colors := map[log.Level]string{
log.DebugLevel: "8",
log.InfoLevel: "6",
log.WarnLevel: "3",
log.ErrorLevel: "1",
log.FatalLevel: "1",
}
for k, v := range colors {
styles.Levels[k] = styles.Levels[k].MaxWidth(5).Width(5).Foreground(lipgloss.Color(v))
}
log.SetStyles(styles)
}