Add error debug logging

I like logging :smile:.