tatut / clj-chrome-devtools

Clojure API for controlling a Chrome DevTools remote
MIT License
130 stars 21 forks source link

Tweak logging when a conn closes on JVM shutdown #23

Closed aviflax closed 5 years ago

aviflax commented 5 years ago

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