/** * <summary> * Register a log callback function. * <para> * This callback will be called each time * the API have something to say. Quite usefull to debug the API. * </para> * </summary> * <param name="logfun"> * a procedure taking a string parameter, or <c>null</c> * to unregister a previously registered callback. * </param> */ public static void RegisterLogFunction(yLogFunc logfun) { ylog = logfun; if (logfun != null) { // native_yLogFunctionDelegate has to be protected from GC by an external reference further down _yapiRegisterLogFunction(Marshal.GetFunctionPointerForDelegate(native_yLogFunctionDelegate)); } else { _yapiRegisterLogFunction(IntPtr.Zero); } }
/** * <summary> * Registers a log callback function. * <para> * This callback will be called each time * the API have something to say. Quite useful to debug the API. * </para> * </summary> * <param name="logfun"> * a procedure taking a string parameter, or <c>null</c> * to unregister a previously registered callback. * </param> */ public static void RegisterLogFunction(yLogFunc logfun) { ylog = logfun; }