websockets logging.

This commit is contained in:
Miroslav Šedivý 2021-08-29 18:23:58 +02:00
parent d00d66e0ec
commit 8f8cd47e85
10 changed files with 115 additions and 64 deletions

View file

@ -6,8 +6,10 @@ import (
)
func (h *MessageHandlerCtx) keyboardMap(session types.Session, payload *message.KeyboardMap) error {
logger := h.logger.With().Str("session_id", session.ID()).Logger()
if !session.IsHost() {
h.logger.Debug().Str("session_id", session.ID()).Msg("is not the host")
logger.Debug().Msg("is not the host")
return nil
}
@ -18,8 +20,10 @@ func (h *MessageHandlerCtx) keyboardMap(session types.Session, payload *message.
}
func (h *MessageHandlerCtx) keyboardModifiers(session types.Session, payload *message.KeyboardModifiers) error {
logger := h.logger.With().Str("session_id", session.ID()).Logger()
if !session.IsHost() {
h.logger.Debug().Str("session_id", session.ID()).Msg("is not the host")
logger.Debug().Msg("is not the host")
return nil
}