Faulty message logging

In an attempt to make finding faulty messages a bit easier, I am adding
logging to the library