Better logging format, fixed Connected/Disconnected messages not showing up in the log, OnConnect is now called before any data processing