use log function for logging