logData func