Failsafe avoid logging when in test mode