setup: add helper to log the connection state

Add a helper to log the enum values as strings. Replace simmilar code and add
new uses.