Change printf to log