public override void Output(string text, Level level) { if (Threshold <= level) { MainConsole.TriggerLog(level.ToString(), text); string ts = Culture.LocaleLogStamp() + " - "; string fullText = string.Format("{0} {1}", ts, text); MainConsole.TriggerLog(level.ToString(), fullText); if (m_logFile != null) { if (m_logDate != DateTime.Now.Date) { RotateLog(); } try { m_logFile.WriteLine(fullText); m_logFile.Flush(); } catch { // encountered an error writing... } } lock (_cmdlock) { if (y == -1) { WriteColorText(ConsoleColor.DarkCyan, ts); WriteLocalText(text, level); return; } y = SetCursorTop(y); SetCursorLeft(0); int count = cmdline.Length + prompt.Length; while (count-- > 0) { Console.Write(" "); } y = SetCursorTop(y); SetCursorLeft(0); WriteColorText(ConsoleColor.DarkCyan, ts); WriteLocalText(text, level); y = Console.CursorTop; Show(); } } }
public virtual void OutputNoTime(string text, Level level) { if (Threshold <= level) { MainConsole.TriggerLog(level.ToString(), text); Console.WriteLine(text); if (m_logFile != null) { m_logFile.WriteLine(text); m_logFile.Flush(); } } }
public virtual void Output(string text, Level level) { if (Threshold <= level) { MainConsole.TriggerLog(level.ToString(), text); text = string.Format("{0} ; {1}", Culture.LocaleLogStamp(), text); Console.WriteLine(text); if (m_logFile != null) { m_logFile.WriteLine(text); m_logFile.Flush(); } } }
public virtual void OutputNoTime(string text, Level level) { if (Threshold <= level) { MainConsole.TriggerLog(level.ToString(), text); Console.WriteLine(text); if (m_logFile != null) { if (m_logDate != DateTime.Now.Date) { RotateLog(); } try { m_logFile.WriteLine(text); m_logFile.Flush(); } catch { // encountered an error writing... } } } }
public virtual void Output(string text, Level level) { if (Threshold <= level) { MainConsole.TriggerLog(level.ToString(), text); text = string.Format("{0} ; {1}", Culture.LocaleLogStamp(), text); Console.WriteLine(text); if (m_logFile != null) { if (m_logDate != DateTime.Now.Date) { RotateLog(); } try { m_logFile.WriteLine(text); m_logFile.Flush(); } catch { // encountered an error writing... } } } }