Optimize handling of unused logging