only log errors if logging is enabled