Description
The only logging we currently have is for tracking connects/disconnects for websockets. We should add some for game events.
We currently have logging for:
- Server initialization (handlers, port being listened to) in
main.go
- Players registering in
player.go: ServeRegister()
- Administrator registering
admin.go: ServeRegister()
- Socket connects/disconnects
socket.go: ServeHTTP/ServeViewer
Events to log
- Players connecting/reconnecting and the snapshot they receive.
- AntiPac and FROSH flag being found
- Players being removed.
- Failed reads/writes.
- Failed message sends/receives and who they were being sent to/received from.
Tasks
We can use the library log/slog to handle this. Use INFO, not DEBUG for messages that aren't errors/warnings.
Description
The only logging we currently have is for tracking connects/disconnects for websockets. We should add some for game events.
We currently have logging for:
main.goplayer.go: ServeRegister()admin.go: ServeRegister()socket.go: ServeHTTP/ServeViewerEvents to log
Tasks
We can use the library
log/slogto handle this. UseINFO, notDEBUGfor messages that aren't errors/warnings.game.state = <value>) togame.SetState(<value>)