allow log function to be supplied by the user