fix: standardize log prefixes, remove duplicates, add missing module tags

Second-pass logging cleanup: consistent [LEVEL] [module] format across
all 41 files. Remove stale prefixes ([CF], [SYNC], [SCHED], [API],
[STORAGE], [HEALTH], [ROLLBACK]). Remove 5 duplicate log lines. Gate
ungated DEBUG lines. Fix wrong log levels (restore start WARN→INFO).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 21:20:09 +01:00
parent 8e61cd7ec4
commit af1dd14933
41 changed files with 477 additions and 473 deletions
+6 -6
View File
@@ -142,11 +142,11 @@ func (m *Manager) Toggle(ctx context.Context, provider, target string, enable bo
state.Enabled = true
state.Status = "active"
state.EnabledAt = time.Now().UTC().Format(time.RFC3339)
m.logger.Printf("[INFO] Integration %s enabled", key)
m.logger.Printf("[INFO] [integrations] Integration %s enabled", key)
} else {
start := time.Now()
if err := handler.Revoke(ac); err != nil {
m.logger.Printf("[WARN] Integration revoke failed for %s: %v", key, err)
m.logger.Printf("[WARN] [integrations] Integration revoke failed for %s: %v", key, err)
state.LastError = err.Error()
}
if m.isDebug() {
@@ -154,7 +154,7 @@ func (m *Manager) Toggle(ctx context.Context, provider, target string, enable bo
}
state.Enabled = false
state.Status = "disabled"
m.logger.Printf("[INFO] Integration %s disabled", key)
m.logger.Printf("[INFO] [integrations] Integration %s disabled", key)
}
if err := m.sett.SetIntegrationState(key, state); err != nil {
@@ -268,7 +268,7 @@ func (m *Manager) ReapplyConfigForTarget(targetName string) {
ac, err := m.buildApplyContext(provider, target)
if err != nil {
m.logger.Printf("[WARN] Cannot build context for integration %s reapply: %v", key, err)
m.logger.Printf("[WARN] [integrations] Cannot build context for integration %s reapply: %v", key, err)
continue
}
@@ -276,7 +276,7 @@ func (m *Manager) ReapplyConfigForTarget(targetName string) {
ac.RestartStack = func(string) error { return nil }
if err := handler.Apply(ac); err != nil {
m.logger.Printf("[WARN] Integration config reapply failed for %s: %v", key, err)
m.logger.Printf("[WARN] [integrations] Integration config reapply failed for %s: %v", key, err)
if m.isDebug() {
m.logger.Printf("[DEBUG] [integrations] ReapplyConfigForTarget: %s failed: %v", key, err)
}
@@ -292,7 +292,7 @@ func (m *Manager) ReapplyConfigForTarget(targetName string) {
state.Status = "active"
state.LastError = ""
_ = m.sett.SetIntegrationState(key, state)
m.logger.Printf("[INFO] Integration %s config reapplied for %s", key, targetName)
m.logger.Printf("[INFO] [integrations] Integration %s config reapplied for %s", key, targetName)
}
}