only log validated code in debug mode