mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 18:30:43 -06:00
change log colors
This commit is contained in:
parent
4230aa175a
commit
53efc5e18c
1 changed files with 9 additions and 2 deletions
|
@ -54,8 +54,15 @@ var rootCmd = &cobra.Command{
|
||||||
func setupLogger() {
|
func setupLogger() {
|
||||||
log.SetReportTimestamp(false)
|
log.SetReportTimestamp(false)
|
||||||
styles := log.DefaultStyles()
|
styles := log.DefaultStyles()
|
||||||
for k, v := range styles.Levels {
|
colors := map[log.Level]string{
|
||||||
styles.Levels[k] = v.Width(5).MaxWidth(5)
|
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)
|
log.SetStyles(styles)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue