Replace print statement with log message