mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-10 23:57:27 +02:00
websockets logging.
This commit is contained in:
parent
d00d66e0ec
commit
8f8cd47e85
10 changed files with 115 additions and 64 deletions
|
@ -7,13 +7,15 @@ import (
|
|||
)
|
||||
|
||||
func (h *MessageHandlerCtx) controlRelease(session types.Session) error {
|
||||
logger := h.logger.With().Str("session_id", session.ID()).Logger()
|
||||
|
||||
if !session.Profile().CanHost {
|
||||
h.logger.Debug().Str("session_id", session.ID()).Msg("is not allowed to host")
|
||||
logger.Debug().Msg("is not allowed to host")
|
||||
return nil
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -24,13 +26,15 @@ func (h *MessageHandlerCtx) controlRelease(session types.Session) error {
|
|||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlRequest(session types.Session) error {
|
||||
logger := h.logger.With().Str("session_id", session.ID()).Logger()
|
||||
|
||||
if !session.Profile().CanHost {
|
||||
h.logger.Debug().Str("session_id", session.ID()).Msg("is not allowed to host")
|
||||
logger.Debug().Msg("is not allowed to host")
|
||||
return nil
|
||||
}
|
||||
|
||||
if session.IsHost() {
|
||||
h.logger.Debug().Str("session_id", session.ID()).Msg("is already the host")
|
||||
logger.Debug().Msg("is already the host")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue