816ac4573: Tweak logging when a conn closes on JVM shutdown
The library that gniazdo wraps (the Jetty WebSocket API/Client)
registers a JVM shutdown hook to (I think) close the connection when the
JVM shuts down. This causes the on-close hook to be called during JVM
shutdown. Currently, this is causing a WARN log message to be emitted
(written to stdout) when the JVM shuts down — even if the WS connection
has been closed beforehand.
Since this case (code 1001 and reason "Shutdown") is a normal,
uninteresting case, it will be better to use the :info log level, so
that in this case the log message will not be output when the JVM shuts
down.
b413ad6: Simplify and streamline on-close handler
I realized that there’s no need for this library to maintain its own
mapping of WS close status codes to reason strings, as I realized that
the Jetty WS library obviously already has such a mapping, as it
passes the reason string to the on-close handler. So I removed it.
Switch to format rather than string concatenation for better
readability.
816ac4573: Tweak logging when a conn closes on JVM shutdown
The library that gniazdo wraps (the Jetty WebSocket API/Client) registers a JVM shutdown hook to (I think) close the connection when the JVM shuts down. This causes the on-close hook to be called during JVM shutdown. Currently, this is causing a WARN log message to be emitted (written to stdout) when the JVM shuts down — even if the WS connection has been closed beforehand.
Since this case (code 1001 and reason "Shutdown") is a normal, uninteresting case, it will be better to use the :info log level, so that in this case the log message will not be output when the JVM shuts down.
b413ad6: Simplify and streamline on-close handler
format
rather than string concatenation for better readability.