Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

refactor: Use zerolog instead of fmt.Printf in config export

rcourtman322573157e52
diff --git a/internal/config/export.go b/internal/config/export.go
index eb4cc0f4ab..bfe947c8f6 100644
--- a/internal/config/export.go
+++ b/internal/config/export.go
@@ -14,6 +14,7 @@ import (
"github.com/rcourtman/pulse-go-rewrite/internal/alerts"
"github.com/rcourtman/pulse-go-rewrite/internal/notifications"
+ "github.com/rs/zerolog/log"
"golang.org/x/crypto/pbkdf2"
)
@@ -157,9 +158,9 @@ func (c *ConfigPersistence) ImportConfig(encryptedData string, passphrase string
case "4.1", "":
// current version, nothing to do
case "4.0":
- fmt.Printf("Notice: Config was exported from version 4.0. API tokens were not included in that format.\n")
+ log.Info().Msg("Config was exported from version 4.0. API tokens were not included in that format.")
default:
- fmt.Printf("Warning: Config was exported from unsupported version %s. Proceeding with best effort.\n", exportData.Version)
+ log.Warn().Str("version", exportData.Version).Msg("Config was exported from unsupported version. Proceeding with best effort.")
}
tx, err := newImportTransaction(c.configDir)
@@ -240,7 +241,7 @@ func (c *ConfigPersistence) ImportConfig(encryptedData string, passphrase string
}
guestMetadataStore := NewGuestMetadataStore(dataPath)
if err := guestMetadataStore.ReplaceAll(exportData.GuestMetadata); err != nil {
- fmt.Printf("Warning: Failed to import guest metadata: %v\n", err)
+ log.Warn().Err(err).Msg("Failed to import guest metadata")
}
return nil