public static void CloseLog() { if (LogToFile && !string.IsNullOrEmpty(LogFileName)) { if (!Directory.Exists(FullLogPath)) { Directory.CreateDirectory(FullLogPath); } using (TextWriter tw = new StreamWriter(Path.Combine(FullLogPath, LogFileName))) { tw.Write(LogString.ToString()); } } }
[Test] public void ToString_() { o(valid.ToString(), "Foo"); Assert.Throws <Ex>(() => invalid.ToString()); }
public static void Log(string message) { LogString.AppendLine(message); EventLogTextView.Text = LogString.ToString(); }