Changed printf format to make it easier to log and parse.
Logging.
Added 2 functions to unify logging.
Added code to limit the number of messages per chanel to 1/second.