Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LogEvent"/> class.
 /// </summary>
 /// <param name="logCallback">The callback method to invoke when the
 ///		<c>Log</c> method is called.</param>
 /// <param name="loglevel">The log event's loglevel.</param>
 /// <param name="time">The time of the log event.</param>
 internal LogEvent(LogCallbackDelegate logCallback, TLoglevel loglevel, DateTime?time = default)
 {
     this.logCallback = logCallback ?? throw new ArgumentNullException(nameof(logCallback));
     this.Loglevel    = loglevel;
     this.Time        = time ?? DateTime.Now;
     this.Details     = new List <object>();
 }
Beispiel #2
0
 public void UnregisterLogCallback(LogCallbackDelegate handler)
 {
     if (null != handler)
     {
         this.logCallbackEventHandler -= handler;
     }
 }
Beispiel #3
0
        private static void SetupDebugLogCallback()
        {
            LogCallbackDelegate callbackDelegate = new LogCallbackDelegate(LogCallback);

            System.IntPtr func = Marshal.GetFunctionPointerForDelegate(callbackDelegate);
            NativePlugin.SetLogFunction(func);
        }
Beispiel #4
0
 public static void UnregisterLogCallback(LogCallbackDelegate handler)
 {
     if (handler != null)
     {
         DebugLog(null, "Remove log callback handler", new object[0]);
         LogCallbackEventHandler = (LogCallbackDelegate)Delegate.Remove(LogCallbackEventHandler, handler);
     }
 }
Beispiel #5
0
 public static void RegisterLogCallback(LogCallbackDelegate handler)
 {
     if (handler != null)
     {
         DebugLog(null, "Add log callback handler", new object[0]);
         LogCallbackEventHandler = (LogCallbackDelegate)Delegate.Combine(LogCallbackEventHandler, handler);
     }
 }
Beispiel #6
0
    /// <summary>
    /// Registers the log callback handler.
    ///
    /// If you need register logcallback using Application.RegisterLogCallback(LogCallback),
    /// you can call this method to replace it.
    ///
    /// <para></para>
    /// </summary>
    /// <param name="handler">Handler.</param>
    public static void RegisterLogCallback(LogCallbackDelegate handler)
    {
        if (handler != null)
        {
            DebugLog(null, "Add log callback handler: {0}", handler);

            _LogCallbackEventHandler += handler;
        }
    }
Beispiel #7
0
    /// <summary>
    /// Unregisters the log callback.
    /// </summary>
    /// <param name="handler">Handler.</param>
    public static void UnregisterLogCallback(LogCallbackDelegate handler)
    {
        if (handler != null)
        {
            DebugLog(null, "Remove log callback handler");

            _LogCallbackEventHandler -= handler;
        }
    }
Beispiel #8
0
        public void InitCSharpModules()
        {
            LogCallbackDelegate logCallback = Log;
            var ipLog = Marshal.GetFunctionPointerForDelegate(logCallback);

            if (ipLog != null)
            {
                RegisterLogCallback(ipLog);
            }
        }
Beispiel #9
0
        /// <summary>
        /// Will do the handshake between c++ and c# for delegates and function pointers.
        /// </summary>
        public void InitCSharpModules()
        {
            LogCallbackDelegate logCallback = Log;
            var dir   = System.IO.Directory.GetCurrentDirectory();
            var ipLog = Marshal.GetFunctionPointerForDelegate(logCallback);

            if (ipLog != null)
            {
                RegisterLogCallback(ipLog);
            }
        }
Beispiel #10
0
        public formMain()
        {
            InitializeComponent();
            logHandler = new LogCallbackDelegate(LoggerFunction);
            ANNWrapper.SetLogHandler(logHandler);

            DirectoryInfo Dir = new DirectoryInfo(Application.StartupPath + "\\ErrorRec");

            if (!Dir.Exists)
            {
                Dir.Create();
            }
            ANNWrapper.SetErrorRecordFolder(Application.StartupPath + "\\ErrorRec");
        }
Beispiel #11
0
		/// <summary>
		/// Registers the c# exception handler by set Application.RegisterLogCallback
		/// </summary>
		/// <param name="level">Level.</param>
		/// <param name="callback">Callback.</param>
		public static void RegisterExceptionHandler (LogSeverity level, LogCallbackDelegate callback)
		{
			if (Application.platform == RuntimePlatform.IPhonePlayer) {
				#if UNITY_IPHONE
                ios.Bugly.RegisterExceptionHandler(level, callback);
				#endif
			} else if (Application.platform == RuntimePlatform.Android) {
				#if UNITY_ANDROID
                android.Bugly.RegisterExceptionHandler(level, callback);
				#endif
			}
		}
Beispiel #12
0
 public static extern bool UWK_Initialize(LogCallbackDelegate logcb, LogErrorDelegate errorcb, ProcessUWKEventDelegate processcb, UWKBetaDelegate betacb, IntPtr initJson);
Beispiel #13
0
	/// <summary>
	/// Unregisters the log callback.
	/// </summary>
	/// <param name="handler">Handler.</param>
	public static void UnregisterLogCallback (LogCallbackDelegate handler)
	{
		if (handler != null) {
			DebugLog (null, "Remove log callback handler");

			LogCallbackEventHandler -= handler;
		}
	}
Beispiel #14
0
	/// <summary>
	/// Registers the log callback handler. 
	/// 
	/// If you need register logcallback using Application.RegisterLogCallback(LogCallback),
	/// you can call this method to replace it.
	/// 
	/// <para></para>
	/// </summary>
	/// <param name="handler">Handler.</param>
	public static void RegisterLogCallback (LogCallbackDelegate handler)
	{
		if (handler != null) {
			DebugLog (null, "Add log callback handler");

			LogCallbackEventHandler += handler;
		}
	}
Beispiel #15
0
 public static extern int UWK_Initialize(LogCallbackDelegate logcb, LogErrorDelegate errorcb, ProcessMessageDelegate processcb, IntPtr initJson);
Beispiel #16
0
 public static extern void egHMAC(IntPtr pEncryptor, byte[] pIn, int inSize, int inOffset, byte[] pOut, ref int outSize);         // 0x00000001806AE7B0-0x00000001806AE890
 public static extern void egsetEncryptorLoggingCallback(IntPtr userData, LogCallbackDelegate callback);                          // 0x00000001806AEB70-0x00000001806AEC10
Beispiel #17
0
		public void RegisterExceptionHandler (LogSeverity level, LogCallbackDelegate callback)
		{
			_logLevel = level;
            
			if (callback != null) {
				_logCallbackDelegate += callback;
			}
            
			if (!_logCallbackRegister) {
				_logCallbackRegister = true;
                
				System.AppDomain.CurrentDomain.UnhandledException += OnUncaughtExceptionHandler;
				ECUnityHelper.RegisterLogCallback (OnLogCallback);
                
				PrintLog (LogSeverity.Log, "Register log callback");
			}
		}
Beispiel #18
0
 public static extern void SetLogHandler(LogCallbackDelegate logger);
Beispiel #19
0
 public static extern int UWK_Initialize(LogCallbackDelegate logcb, LogErrorDelegate errorcb, ProcessMessageDelegate processcb, IntPtr initJson);
Beispiel #20
0
		/// <summary>
		/// Registers the exception handler.
		/// </summary>
		/// <param name="level">Level.</param>
		/// <param name="callback">Callback.</param>
		public static void RegisterExceptionHandler (LogSeverity level, LogCallbackDelegate callback)
		{
			BuglyAgent.GetInstance ().RegisterExceptionHandler (level, callback);
		}
Beispiel #21
0
 private static extern void edf_set_log_function(LogCallbackDelegate pointer);
Beispiel #22
0
 public static extern uint egread(IntPtr pConnectionHandler, byte[] arr, ref uint size);                                                                                                                          // 0x0000000180A10270-0x0000000180A10320
 public static extern void egsetSocketLoggingCallback(IntPtr pConnectionHandler, IntPtr userData, LogCallbackDelegate callback);                                                                                  // 0x0000000180A10450-0x0000000180A104F0
Beispiel #23
0
 public static extern void mame_set_log_callback(LogCallbackDelegate cb);
Beispiel #24
0
 public void SetLogCallback(Action <string> callback)
 {
     _log = new LogCallbackDelegate(callback);
 }