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:
@@ -178,8 +178,11 @@ func (s *Syncer) doSync() SyncResult {
|
||||
|
||||
result := SyncResult{OK: true}
|
||||
|
||||
s.logger.Printf("[INFO] [sync] Starting catalog sync")
|
||||
|
||||
// Step 1: Clone or pull
|
||||
if err := s.gitCloneOrPull(); err != nil {
|
||||
s.logger.Printf("[ERROR] [sync] Catalog sync failed: %v", err)
|
||||
s.mu.Lock()
|
||||
s.lastErr = err
|
||||
s.lastSync = time.Now()
|
||||
@@ -190,6 +193,7 @@ func (s *Syncer) doSync() SyncResult {
|
||||
// Step 2: Copy templates to stacks dir
|
||||
newApps, updated, err := s.copyTemplates()
|
||||
if err != nil {
|
||||
s.logger.Printf("[ERROR] [sync] Catalog sync failed: %v", err)
|
||||
s.mu.Lock()
|
||||
s.lastErr = err
|
||||
s.lastSync = time.Now()
|
||||
@@ -229,6 +233,8 @@ func (s *Syncer) doSync() SyncResult {
|
||||
result.Message = "Sablonok frissítve — " + strings.Join(parts, "; ")
|
||||
}
|
||||
|
||||
s.logger.Printf("[INFO] [sync] Catalog sync complete")
|
||||
|
||||
s.mu.Lock()
|
||||
s.lastErr = nil
|
||||
s.lastSync = time.Now()
|
||||
@@ -344,7 +350,7 @@ func (s *Syncer) copyTemplates() (newApps []string, updated []string, err error)
|
||||
|
||||
changed, err := copyIfChanged(src, dst)
|
||||
if err != nil {
|
||||
s.logger.Printf("[SYNC] Failed to copy %s/%s: %v", appName, filename, err)
|
||||
s.logger.Printf("[WARN] [sync] Failed to copy catalog file %s/%s: %v", appName, filename, err)
|
||||
continue
|
||||
}
|
||||
if changed {
|
||||
|
||||
Reference in New Issue
Block a user