Example #1
0
 private void Fatal(BasicReturnEventArgs a)
 {
     lock (_oSendLock)
     {
         if (OnFatal != null)
         {
             OnFatal.Invoke(this, a);
         }
         else
         {
             throw new ApplicationException("No subscribers for fatal error event");
         }
     }
 }
Example #2
0
File: BTDebug.cs Project: nistck/Jx
 public static void Fatal(string message, params object[] args)
 {
     OnFatal?.Invoke(message, args);
     Print("Fatal", message, args);
 }
Example #3
0
 protected override void GatedFatal(string message)
 {
     OnFatal?.Invoke(message);
     OnLog?.Invoke(LogLevel.Fatal, message);
 }
Example #4
0
 public static void Fatal(string message, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) =>
 OnFatal?.Invoke(message, file, line);
Example #5
0
        public static void ClearListeners()
        {
            try
            {
                if (OnDebug != null)
                {
                    foreach (Delegate invoker in OnDebug.GetInvocationList())
                    {
                        OnDebug -= (LogEventHandler)invoker;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            try
            {
                if (OnError != null)
                {
                    foreach (Delegate invoker in OnError.GetInvocationList())
                    {
                        OnError -= (LogEventHandler)invoker;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            try
            {
                if (OnFatal != null)
                {
                    foreach (Delegate invoker in OnFatal.GetInvocationList())
                    {
                        OnFatal -= (LogEventHandler)invoker;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            try
            {
                if (OnInfo != null)
                {
                    foreach (Delegate invoker in OnInfo.GetInvocationList())
                    {
                        OnInfo -= (LogEventHandler)invoker;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            try
            {
                if (OnVerbose != null)
                {
                    foreach (Delegate invoker in OnVerbose.GetInvocationList())
                    {
                        OnVerbose -= (LogEventHandler)invoker;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            try
            {
                if (OnWarn != null)
                {
                    foreach (Delegate invoker in OnWarn.GetInvocationList())
                    {
                        OnWarn -= (LogEventHandler)invoker;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }