public void DebugError(object sender, string msg, Exception ex)
 {
     try
     {
         if (mLogXmlWriter != null)
         {
             CustomXmlAttribute[] attributes = new CustomXmlAttribute[]
             {
                 new CustomXmlAttribute("Time", SimClock.CurrentTime().ToString()),
                 new CustomXmlAttribute("Sender", sender.GetType().Name),
                 new CustomXmlAttribute("Id", GetId(sender))
             };
             mLogXmlWriter.WriteElementString("Log", ScriptError.Escape(msg), attributes);
             if (ex != null)
             {
                 mLogXmlWriter.WriteElementString("Error", ex.Message + Message.NewLine + ex.StackTrace, attributes);
             }
             mLogXmlWriter.FlushBufferToFile();
         }
     }
     catch (Exception e)
     {
         Message.Sender.Show("Cannot write debug log");
     }
 }
示例#2
0
 public void Debug(object sender, string msg)
 {
     try
     {
         if (mLogXmlWriter != null)
         {
             CustomXmlAttribute[] attributes = new CustomXmlAttribute[]
             {
                 new CustomXmlAttribute("Time", SimClock.CurrentTime().ToString()),
                 new CustomXmlAttribute("Sender", sender.GetType().Name),
                 new CustomXmlAttribute("Id", GetId(sender))
             };
             mLogXmlWriter.WriteElementString("Log", ScriptError.Escape(msg), attributes);
             mLogXmlWriter.FlushBufferToFile();
         }
     }
     catch (Exception ex)
     {
     }
 }