Skip to content

Commit a307280

Browse files
committed
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.
1 parent 0053fda commit a307280

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

protofsm/state_machine.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ func (s *StateMachine[Event, Env]) Stop() {
237237
//
238238
// TODO(roasbeef): bool if processed?
239239
func (s *StateMachine[Event, Env]) SendEvent(ctx context.Context, event Event) {
240-
s.log.DebugS(ctx, "Sending event",
241-
"event", lnutils.SpewLogClosure(event))
240+
s.log.Debugf("Sending event %T", event)
242241

243242
select {
244243
case s.events <- event:
@@ -544,9 +543,6 @@ func (s *StateMachine[Event, Env]) applyEvents(ctx context.Context,
544543
currentState State[Event, Env], newEvent Event) (State[Event, Env],
545544
error) {
546545

547-
s.log.DebugS(ctx, "Applying new event",
548-
"event", lnutils.SpewLogClosure(newEvent))
549-
550546
eventQueue := fn.NewQueue(newEvent)
551547

552548
// Given the next event to handle, we'll process the event, then add

0 commit comments

Comments
 (0)