more consistent logging for errors