From a307280c40e7e596b06af1f92908109744ac4192 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 26 Mar 2025 16:23:04 -0700 Subject: [PATCH] protofsm: reduce log spam during state transitions In this commit, we reduce log spam a bit during state transitions. We only log the type of the event when sending the event, as we'll print the same event when creating the queue "applying", and later when processing". Next we remove the "applying" log as that first event will always be logged twice. The combo of these to changes makes the logs much easier to follow. --- protofsm/state_machine.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/protofsm/state_machine.go b/protofsm/state_machine.go index c759d061a..3930fdff2 100644 --- a/protofsm/state_machine.go +++ b/protofsm/state_machine.go @@ -237,8 +237,7 @@ func (s *StateMachine[Event, Env]) Stop() { // // TODO(roasbeef): bool if processed? func (s *StateMachine[Event, Env]) SendEvent(ctx context.Context, event Event) { - s.log.DebugS(ctx, "Sending event", - "event", lnutils.SpewLogClosure(event)) + s.log.Debugf("Sending event %T", event) select { case s.events <- event: @@ -544,9 +543,6 @@ func (s *StateMachine[Event, Env]) applyEvents(ctx context.Context, currentState State[Event, Env], newEvent Event) (State[Event, Env], error) { - s.log.DebugS(ctx, "Applying new event", - "event", lnutils.SpewLogClosure(newEvent)) - eventQueue := fn.NewQueue(newEvent) // Given the next event to handle, we'll process the event, then add