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); }
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(); }
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; } } }
private void WriteEntry(LogEntryKind kind, string message, DateTime timeStamp) { WriteLineWithIndent(timeStamp, "[{0}] {1}", kind.ToString(), message); }
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; } } }