From 4ae93338a5f2038be13afcd024e7720bc3d2810b Mon Sep 17 00:00:00 2001 From: Karchnu Date: Mon, 31 Aug 2020 05:04:00 +0200 Subject: [PATCH] websocketd: replace warnings with debug (for example: ping/pong messages) --- src/websocketd.cr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/websocketd.cr b/src/websocketd.cr index 30be38d..37adeb9 100644 --- a/src/websocketd.cr +++ b/src/websocketd.cr @@ -306,7 +306,7 @@ def websocket_switching_procedure (activefd : Int) still_something_to_read = ! wsclient.ws.io.empty? if wsclient.closed? - Baguette::Log.error "client #{activefd} is closed" + Baguette::Log.error "client #{activefd} is closing" Context.context.remove_fd activefd return end @@ -323,21 +323,21 @@ def websocket_switching_procedure (activefd : Int) Context.context.remove_fd activefd return when WebSocket::Ping - Baguette::Log.warning "Received a ping message" + Baguette::Log.debug "Received a ping message" if still_something_to_read Baguette::Log.info "Still something to read" next end break when WebSocket::Pong - Baguette::Log.warning "Received a pong message" + Baguette::Log.debug "Received a pong message" if still_something_to_read Baguette::Log.info "Still something to read" next end break when WebSocket::Close - Baguette::Log.warning "Received a close message" + Baguette::Log.debug "Received a close message" Context.context.remove_fd activefd if still_something_to_read Baguette::Log.info "Still something to read" @@ -345,7 +345,7 @@ def websocket_switching_procedure (activefd : Int) end return when WebSocket::NotFinal - Baguette::Log.warning "Received only part of a message" + Baguette::Log.warning "Received only part of a message (not supported)" if still_something_to_read Baguette::Log.info "Still something to read" next @@ -354,7 +354,7 @@ def websocket_switching_procedure (activefd : Int) when Bytes # TODO: when receiving a binary message # we should test the format and maybe its content - Baguette::Log.warning "Received a binary message" + Baguette::Log.warning "Received a binary message (not supported)" if still_something_to_read Baguette::Log.info "Still something to read" next