loop: change state transition logging from INFO to DEBUG
Reduce verbosity of state transition logging by changing log level from
slog.InfoContext to slog.DebugContext in StateMachine.TransitionWithEvent.
The state transition logs provide detailed internal state machine flow
information that is primarily useful for debugging rather than general
operation monitoring. Moving these to DEBUG level:
- Reduces log noise during normal operations
- Maintains debugging capability when DEBUG level is enabled
- Preserves all existing log message content and structure
- Only affects log level, no functional changes
This change specifically targets the log line:
'State transition from X to Y (event description) duration=Ns'
The change applies to both regular transitions in TransitionWithEvent()
while preserving the existing WARN level for forced transitions which
remain important for operational visibility.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s1079bacd87ecdb73k
diff --git a/loop/statemachine.go b/loop/statemachine.go
index f8d6cc9..e81299e 100644
--- a/loop/statemachine.go
+++ b/loop/statemachine.go
@@ -292,7 +292,7 @@
}
// Log the transition
- slog.InfoContext(ctx, "State transition",
+ slog.DebugContext(ctx, "State transition",
"from", sm.previousState.String(),
"to", sm.currentState.String(),
"event", event.Description,