Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Dec 19, 2024
1 parent e2ed10b commit d44c0d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lavinmq/amqp/connection_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ module LavinMQ
elsif proto != AMQP::PROTOCOL_START_0_9_1 && proto != AMQP::PROTOCOL_START_0_9
socket.write AMQP::PROTOCOL_START_0_9_1.to_slice
socket.flush
log.warn { "Unexpected protocol '#{String.new(proto.to_slice)}', closing socket" }
log.warn {
bad_protocol = String.new(proto.to_slice).gsub(/\n/, "\\n")
"Unexpected protocol '#{bad_protocol}', closing socket"
}
false
else
true
Expand Down

0 comments on commit d44c0d6

Please sign in to comment.