public static void Register(DebugLogEntry entry) { lock (m_sync) { m_last.m_next = entry; m_last = entry; } }
public static void DumpToFile(DebugLogEntry start = null) { var first = (start == null) ? DebugLogEntry.First : start; var entry = first; using (System.IO.FileStream dump = new System.IO.FileStream( System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\StepBro DebugLog.txt", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None)) { using (System.IO.StreamWriter writer = new System.IO.StreamWriter(dump)) { while (entry != null) { writer.WriteLine(entry.Timestamp.ToMinutesTimestamp(first.Timestamp) + " " + entry.ToString()); entry = entry.Next; } } } }
static DebugLogEntry() { First = m_last = new DebugLogEntryString("DebugLog Created"); }