🔊 Verbose websocket connection logging

This commit is contained in:
2024-11-17 21:01:20 +08:00
parent ab9bc5d127
commit 90741379d6
2 changed files with 24 additions and 2 deletions

View File

@ -32,7 +32,10 @@ func (v *Server) PushStream(ctx context.Context, request *proto.PushStreamReques
log.Debug().
Uint64("client_id", request.GetClientId()).
Uint64("user_id", request.GetUserId()).
Msgf("Pushing a websocket package to client / user...")
Int("count", cnt).
Int("success", success).
Int("failed", len(errs)).
Msgf("Pushed a websocket package to client / user...")
if len(errs) > 0 {
// Partial fail
@ -72,6 +75,14 @@ func (v *Server) PushStreamBatch(ctx context.Context, request *proto.PushStreamB
errs = append(errs, cErrs...)
}
log.Debug().
Any("client_id", request.GetClientId()).
Any("user_id", request.GetUserId()).
Int("count", cnt).
Int("success", success).
Int("failed", len(errs)).
Msgf("Pushed a websocket package to client / user...")
if len(errs) > 0 {
// Partial fail
return &proto.PushStreamResponse{