Esempio n. 1
0
        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();
                }
            }
        }
Esempio n. 2
0
 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();
         }
     }
 }
Esempio n. 3
0
        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();
                }
            }
        }
Esempio n. 4
0
        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...
                    }
                }
            }
        }
Esempio n. 5
0
        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...
                    }
                }
            }
        }