feat: comprehensive debug logging across all controller modules
Add detailed [DEBUG] logging to every controller module when logging.level is set to "debug". Each module with stateful debug uses SetDebug(bool) wired from main.go. Covers stacks, backup, cloudflare, integrations, system, monitor, settings, scheduler, web handlers, storage, metrics, API, selfupdate, and assets. Also includes the app export/import (.fab bundles) feature from v0.32.0 and its debug page integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,8 @@ func (m *Manager) RunHealthProbes() error {
|
||||
// Phase 1: collect targets (under lock)
|
||||
m.mu.RLock()
|
||||
var targets []probeTarget
|
||||
skippedNotDue := 0
|
||||
skippedNoContainer := 0
|
||||
for name, stack := range m.stacks {
|
||||
if stack.State != StateRunning && stack.State != StateUnhealthy {
|
||||
continue
|
||||
@@ -43,6 +45,12 @@ func (m *Manager) RunHealthProbes() error {
|
||||
effectiveInterval = 10 * time.Second
|
||||
}
|
||||
if time.Since(stack.HealthProbe.LastCheck) < effectiveInterval {
|
||||
skippedNotDue++
|
||||
if m.isDebug() {
|
||||
sinceLastCheck := time.Since(stack.HealthProbe.LastCheck).Round(time.Second)
|
||||
m.logger.Printf("[DEBUG] [stacks] RunHealthProbes: skipping %s — last check %s ago, effective interval %s, healthy=%v",
|
||||
name, sinceLastCheck, effectiveInterval, stack.HealthProbe.Healthy)
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -50,6 +58,7 @@ func (m *Manager) RunHealthProbes() error {
|
||||
// Find the main container to probe (matching stack name)
|
||||
containerName := findProbeContainer(name, stack.Containers)
|
||||
if containerName == "" {
|
||||
skippedNoContainer++
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -61,6 +70,11 @@ func (m *Manager) RunHealthProbes() error {
|
||||
}
|
||||
m.mu.RUnlock()
|
||||
|
||||
if m.isDebug() {
|
||||
m.logger.Printf("[DEBUG] [stacks] RunHealthProbes: collected %d targets (%d skipped not due, %d skipped no container)",
|
||||
len(targets), skippedNotDue, skippedNoContainer)
|
||||
}
|
||||
|
||||
if len(targets) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user