mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user