예제 #1
0
 public static void Write(string source, Exception ex)
 {
     if (_debug != null)
     {
         lock (_lockObj)
         {
             _debug.Write(DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss") + "\t" + source + "\t" + ex.Message + "\r\nStack Trace: \r\n\t" + ex.StackTrace + "\r\n\r\n");
         }
     }
 }
예제 #2
0
 public async void Execute()
 {
     try
     {
         await Run();
     }
     catch (Exception exception)
     {
         debug.Write("Error at Execute: " + exception.ToString());
         gui.SetState(LauncherState.Error);
         gui.AddUserMessage("Wurm Assistant Launcher has encountered an error: " + exception.ToStringMessagesOnly(), Color.Red);
         gui.ShowGui();
     }
 }
예제 #3
0
        public void AddUserMessage(string message, Color?textColor = null)
        {
            ThreadSafeInvoke(() =>
            {
                debug.Write(message + Environment.NewLine);
                var newString = DateTime.Now + " > " + message + Environment.NewLine;
                messages.Add(new OutputMessage()
                {
                    Content = newString,
                    Color   = textColor
                });

                RebuildOutput();
            });
        }
예제 #4
0
파일: Debug.cs 프로젝트: bansicloud/Mesh-1
 public static void Write(string source, string message)
 {
     if (_debug != null)
     {
         Monitor.Enter(_lockObj);
         try
         {
             _debug.Write("[" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "] [" + source + "] " + message + "\r\n");
         }
         catch
         { }
         finally
         {
             Monitor.Exit(_lockObj);
         }
     }
 }