feat: comprehensive INFO/WARN/ERROR logging across all controller modules

Add structured operational logging at INFO, WARN, and ERROR levels to
every controller module. Standardize custom prefixes ([GEO], [SCHED],
[SYNC]) to use [INFO/WARN/ERROR] [module] format. Fix misleveled logs
(WARN->ERROR for data loss scenarios, WARN->INFO for routine operations).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 19:58:27 +01:00
parent 95c821deb2
commit 8e61cd7ec4
44 changed files with 326 additions and 44 deletions
+6 -2
View File
@@ -218,7 +218,7 @@ func (s *Syncer) setError(err error) {
TotalBytes: s.status.TotalBytes,
}
s.mu.Unlock()
s.logger.Printf("[WARN] Asset sync failed: %v", err)
s.logger.Printf("[ERROR] [assets] Asset sync failed: %v", err)
}
func (s *Syncer) fetchManifest(ctx context.Context) (*HubManifest, error) {
@@ -316,14 +316,18 @@ func (s *Syncer) downloadFile(ctx context.Context, filename string) error {
func (s *Syncer) saveLocalManifest(manifest *HubManifest) {
data, err := json.MarshalIndent(manifest, "", " ")
if err != nil {
s.logger.Printf("[ERROR] [assets] Failed to save local manifest: %v", err)
return
}
path := filepath.Join(s.assetsDir, "manifest.json")
tmp := path + ".tmp"
if err := os.WriteFile(tmp, data, 0644); err != nil {
s.logger.Printf("[ERROR] [assets] Failed to save local manifest: %v", err)
return
}
os.Rename(tmp, path)
if err := os.Rename(tmp, path); err != nil {
s.logger.Printf("[ERROR] [assets] Failed to save local manifest: %v", err)
}
}
func fileSHA256(path string) (string, error) {