change out.print to log