CFY-1232 make logging funcs mockable
CFY-1232 flake8