Replace printf with the logger functions.