diff options
| author | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-09-02 15:14:02 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-09-02 15:14:02 +0200 |
| commit | 5e05784cab953b0e24609398106dd33da7738d21 (patch) | |
| tree | ad6f1a8eaa16a5dc38d7849941abe6537d48d00b /client/fsm.go | |
| parent | 53b40a5353df751d10c8480749b2c1929895c3e6 (diff) | |
client: Log more in debug and increase rotation to 10MB
Diffstat (limited to 'client/fsm.go')
| -rw-r--r-- | client/fsm.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/fsm.go b/client/fsm.go index 673f3fb..e3a8cc0 100644 --- a/client/fsm.go +++ b/client/fsm.go @@ -170,7 +170,14 @@ func newFSM( }, } - return fsm.NewFSM(StateMain, states, callback, GetStateName) + cbLogged := func(oldState FSMStateID, newState FSMStateID, data any) bool { + if oldState != newState { + slog.Debug("FSM transition", "old", GetStateName(oldState), "new", GetStateName(newState)) + } + return callback(oldState, newState, data) + } + + return fsm.NewFSM(StateMain, states, cbLogged, GetStateName) } // SetState sets the state for the client FSM to `state` |
