コード例 #1
0
 public static void WriteLine(this TestContext testContext, LogEntryKind logEntryKind, string message, params object[] args)
 {
     Console.Out.WriteLine(
         "{0}-[{1}]: {2}",
         DateTime.Now.ToString("yy-MM-dd hh:mm:ss.fffffff"),
         logEntryKind.ToString(),
         message,
         args);
 }
コード例 #2
0
 private void WriteEntry(LogEntryKind kind, string message, DateTime timeStamp, string testCaseName)
 {
     Writer.WriteStartElement("LogEntry");
     Writer.WriteAttributeString("kind", kind.ToString());
     Writer.WriteAttributeString("timeStamp", GetTimeStampString(timeStamp));
     if (kind == LogEntryKind.Checkpoint && !string.IsNullOrEmpty(testCaseName))
     {
         Writer.WriteAttributeString("testCase", testCaseName);
     }
     Writer.WriteElementString("Message", ReplaceInvalidChars(message));
     Writer.WriteEndElement();
 }
コード例 #3
0
 private void WriteAny(LogEntryKind kind, string message, DateTime timeStamp)
 {
     if (sw == null)
     {
         return;
     }
     if (!String.IsNullOrEmpty(message))
     {
         try
         {
             sw.Write(
                 timeStampFormat,  // format sting
                 timeStamp.Year,   // paramters
                 timeStamp.Month,
                 timeStamp.Day,
                 timeStamp.Hour,
                 timeStamp.Minute,
                 timeStamp.Second,
                 timeStamp.Millisecond);
             sw.Write(String.Format(" [{0}] {1}\n", kind.ToString(), message));
         }
         catch { sw = null; }
     }
 }
コード例 #4
0
 private void WriteEntry(LogEntryKind kind, string message, DateTime timeStamp)
 {
     WriteLineWithIndent(timeStamp, "[{0}] {1}", kind.ToString(), message);
 }
コード例 #5
0
 private void WriteEntry(LogEntryKind kind, string message, DateTime timeStamp, string testCaseName)
 {
     Writer.WriteStartElement("LogEntry");
     Writer.WriteAttributeString("kind", kind.ToString());
     Writer.WriteAttributeString("timeStamp", GetTimeStampString(timeStamp));
     if (kind == LogEntryKind.Checkpoint && !string.IsNullOrEmpty(testCaseName))
     {
         Writer.WriteAttributeString("testCase", testCaseName);
     }
     Writer.WriteElementString("Message", ReplaceInvalidChars(message));
     Writer.WriteEndElement();
 }
コード例 #6
0
 private void WriteEntry(LogEntryKind kind, string message, DateTime timeStamp)
 {
     WriteLineWithIndent(timeStamp, "[{0}] {1}", kind.ToString(), message);
 }
コード例 #7
0
 private void WriteAny(LogEntryKind kind, string message, DateTime timeStamp)
 {
     if (sw == null) return;
     if (!String.IsNullOrEmpty(message))
     {
         try
         {
             sw.Write(
                 timeStampFormat,  // format sting
                 timeStamp.Year,      // paramters
                 timeStamp.Month,
                 timeStamp.Day,
                 timeStamp.Hour,
                 timeStamp.Minute,
                 timeStamp.Second,
                 timeStamp.Millisecond);
             sw.Write(String.Format(" [{0}] {1}\n", kind.ToString(), message));
         }
         catch { sw = null; }
     }
 }