/// <summary> /// Set the callback function to use for SDK log messages. Any previously set callback will no longer be called. /// <seealso cref="Platform.PlatformInterface.Initialize" /> /// </summary> /// <param name="callback">the function to call when the SDK logs messages</param> /// <returns> /// <see cref="Result.Success" /> is returned if the callback will be used for future log messages. /// <see cref="Result.NotConfigured" /> is returned if the SDK has not yet been initialized, or if it has been shut down /// </returns> public static Result SetCallback(LogMessageFunc callback) { var callbackInternal = new LogMessageFuncInternal(LogMessageFuncInternalImplementation); Helper.AddStaticCallback("LogMessageFuncInternalImplementation", callback, callbackInternal); var funcResult = EOS_Logging_SetCallback(callbackInternal); return(funcResult); }
/// <summary> /// Set the callback function to use for SDK log messages. Any previously set callback will no longer be called. /// <seealso cref="Platform.PlatformInterface.Initialize" /> /// </summary> /// <param name="callback">the function to call when the SDK logs messages</param> /// <returns> /// <see cref="Result.Success" /> is returned if the callback will be used for future log messages. /// <see cref="Result.NotConfigured" /> is returned if the SDK has not yet been initialized, or if it has been shut down /// </returns> public static Result SetCallback(LogMessageFunc callback) { var callbackInternal = new LogMessageFuncInternal(LogMessageFunc); s_LogMessageFunc = callback; s_LogMessageFuncInternal = callbackInternal; var funcResult = EOS_Logging_SetCallback(callbackInternal); var funcResultReturn = Helper.GetDefault <Result>(); Helper.TryMarshalGet(funcResult, out funcResultReturn); return(funcResultReturn); }
internal static extern Result EOS_Logging_SetCallback(LogMessageFuncInternal callback);