Skip to content

Commit

Permalink
Improve stream logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Apr 15, 2024
1 parent 79e04e2 commit 850b592
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/asciinema_web/live_stream_consumer_socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule AsciinemaWeb.LiveStreamConsumerSocket do
def websocket_info(%LiveStreamServer.Update{event: e, data: data}, state)
when e in [:info, :reset] do
{{cols, rows}, _, _, _} = data
Logger.info("consumer/#{state.stream_id}: reset (#{cols}x#{rows})")
Logger.debug("consumer/#{state.stream_id}: reset (#{cols}x#{rows})")

{:reply, reset_message(data), %{state | reset: true}}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/asciinema_web/live_stream_producer_socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ defmodule AsciinemaWeb.LiveStreamProducerSocket do
{:reply, {:close, 4004, "bandwidth exceeded"}, state}

{:parser, reason, message} ->
Logger.debug("producer/#{state.stream_id}: message: #{inspect(message)}")
Logger.warn("producer/#{state.stream_id}: parser error: #{reason}")
Logger.debug("producer/#{state.stream_id}: message: #{inspect(message)}")

{:reply, {:close, 4005, "message parsing error"}, state}

Expand Down

0 comments on commit 850b592

Please sign in to comment.