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:
@@ -41,7 +41,7 @@ func (m *Manager) OnStackStop(_ context.Context, stackName string) {
|
||||
|
||||
ac, err := m.buildApplyContext(provider, target)
|
||||
if err != nil {
|
||||
m.logger.Printf("[WARN] Cannot build context for integration %s revoke: %v", key, err)
|
||||
m.logger.Printf("[WARN] [integrations] Cannot build context for integration %s revoke: %v", key, err)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func (m *Manager) OnStackStop(_ context.Context, stackName string) {
|
||||
m.logger.Printf("[DEBUG] [integrations] OnStackStop: revoking %s", key)
|
||||
}
|
||||
if err := handler.Revoke(ac); err != nil {
|
||||
m.logger.Printf("[WARN] Integration revoke on stop failed for %s: %v", key, err)
|
||||
m.logger.Printf("[WARN] [integrations] Integration revoke on stop failed for %s: %v", key, err)
|
||||
}
|
||||
|
||||
if provider == stackName {
|
||||
@@ -58,7 +58,7 @@ func (m *Manager) OnStackStop(_ context.Context, stackName string) {
|
||||
state.Status = "target_unavailable"
|
||||
}
|
||||
_ = m.sett.SetIntegrationState(key, state)
|
||||
m.logger.Printf("[INFO] Integration %s suspended (stack %s stopped)", key, stackName)
|
||||
m.logger.Printf("[INFO] [integrations] Integration %s suspended (stack %s stopped)", key, stackName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,12 +126,12 @@ func (m *Manager) OnStackStart(_ context.Context, stackName string) {
|
||||
|
||||
ac, err := m.buildApplyContext(provider, target)
|
||||
if err != nil {
|
||||
m.logger.Printf("[WARN] Cannot re-apply integration %s on start: %v", key, err)
|
||||
m.logger.Printf("[WARN] [integrations] Cannot re-apply integration %s on start: %v", key, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if err := handler.Apply(ac); err != nil {
|
||||
m.logger.Printf("[WARN] Integration re-apply on start failed for %s: %v", key, err)
|
||||
m.logger.Printf("[ERROR] [integrations] Integration re-apply on start failed for %s: %v", key, err)
|
||||
state.Status = "error"
|
||||
state.LastError = err.Error()
|
||||
_ = m.sett.SetIntegrationState(key, state)
|
||||
@@ -141,7 +141,7 @@ func (m *Manager) OnStackStart(_ context.Context, stackName string) {
|
||||
state.Status = "active"
|
||||
state.LastError = ""
|
||||
_ = m.sett.SetIntegrationState(key, state)
|
||||
m.logger.Printf("[INFO] Integration %s re-activated (stack %s started)", key, stackName)
|
||||
m.logger.Printf("[INFO] [integrations] Integration %s re-activated (stack %s started)", key, stackName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +186,6 @@ func (m *Manager) OnStackRemove(_ context.Context, stackName string) {
|
||||
}
|
||||
|
||||
_ = m.sett.RemoveIntegrationState(key)
|
||||
m.logger.Printf("[INFO] Integration %s removed (stack %s removed)", key, stackName)
|
||||
m.logger.Printf("[INFO] [integrations] Integration %s removed (stack %s removed)", key, stackName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user