[fix] only log msg rx if debug mode in enabled
[fix] only attempt to encode data if of type string
[fix] indentation
[fix] timeout was interpreted as arg because kwarg was missing