@log_func: A function to handle log messages. @user_data: User data for @log_func.
Sets the function to be called to handle logging.
See Implementation