add string formatting helper for logging errors that have an exception with them