added debug log output to palette export

This commit is contained in:
Daniel Sommer 2023-11-21 14:48:49 +01:00
parent f8a12261ea
commit 2b26dd2ee0

View file

@ -19,6 +19,7 @@ func exportPalette(colors []color.Color) {
if len(colors) == 0 || !config.IsPaletteSet() {
return
}
timestamp := time.Now().UnixMilli()
var palette string
for index, color := range colors {
if index > 0 {
@ -33,7 +34,9 @@ func exportPalette(colors []color.Color) {
}
error := os.WriteFile(config.Palette, []byte(palette), 0775)
if error != nil {
loggo.Error("encountered an error exporting a color palette", error.Error())
loggo.ErrorTimed("encountered an error exporting a color palette", timestamp, error.Error())
} else {
loggo.DebugTimed("exported color palette to filesystem", timestamp, "path: "+config.Palette)
}
}