replace a printf with a logging call