If you disagree with either of these changes or this doesn't do the trick for ya then just let me know.
Does stem have a way to log all it's control messages?
Yup. As mentioned on irc trace runlevel logging provide request/reply logs for its control port. That is to say, exactly what we send and receive...
% ./run_tests.py --integ --log TRACE05/27/2019 16:02:23 [TRACE] Sent to tor: PROTOCOLINFO 105/27/2019 16:02:23 [TRACE] Received from tor: 250-PROTOCOLINFO 1 250-AUTH METHODS=NULL 250-VERSION Tor="0.4.1.0-alpha-dev" 250 OK05/27/2019 16:02:23 [TRACE] Sent to tor: AUTHENTICATE05/27/2019 16:02:23 [TRACE] Received from tor: 250 OK05/27/2019 16:02:23 [TRACE] Sent to tor: SETEVENTS STATUS_SERVER SIGNAL CONF_CHANGED05/27/2019 16:02:23 [TRACE] Received from tor: 250 OK... etc...