예제 #1
0
        /// <summary>
        /// Writes a special line of log, with customizeable colors and header coloring of logText.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        /// <param name="headerHead">The string to use infront of logText.</param>
        /// <param name="headerLength">The length of the header to color.</param>
        /// <param name="headerColor">The color for the header in the logText.</param>
        public static void WriteSpecialLine(string logText, logFlags logFlag, bool debugmode, ConsoleColor colorOne, ConsoleColor colorTwo, string headerHead, int headerLength, ConsoleColor headerColor)
        {
            //if ((int)logFlag < (int)minimumImportance)
            //return;

            DateTime   _DTN = DateTime.Now;
            StackFrame _SF  = new StackTrace().GetFrame(1);

            if (debugmode == true)
            {
                Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] <");
            }
            else
            {
                Console.Write("[" + _DTN.ToLongTimeString() + "] <");
            }

            Console.ForegroundColor = colorOne;
            Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("> " + headerHead + " ");
            Console.ForegroundColor = headerColor;
            Console.Write(logText.Substring(0, headerLength));
            Console.ForegroundColor = colorTwo;
            Console.WriteLine(logText.Substring(headerLength));
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #2
0
        /// <summary>
        /// Prints a customizeable line of log, together with timestamp and title.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        /// <param name="Title">The title of the log.</param>
        public static void Write(string logText, logFlags logFlag, bool debugmode, ConsoleColor colorOne, ConsoleColor colorTwo, string Title)
        {
            if ((int)logFlag < (int)minimumImportance)
            {
                return;
            }

            DateTime _DTN = DateTime.Now;

            if (debugmode == true)
            {
                Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(Title);
            }
            else
            {
                Console.Write("[" + _DTN.ToLongTimeString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(Title);
            }

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("> :: ");
            Console.ForegroundColor = colorTwo;
            Console.Write(logText);
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #3
0
        /// <summary>
        /// Prints a customizeable line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        public static void WriteLine(string logText, logFlags logFlag, bool debugmode, ConsoleColor colorOne, ConsoleColor colorTwo)
        {
            if ((int)logFlag < (int)minimumImportance)
            {
                return;
            }

            DateTime   _DTN = DateTime.Now;
            StackFrame _SF  = new StackTrace().GetFrame(1);

            if (debugmode == true)
            {
                Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(_SF.GetMethod().ReflectedType.FullName + "." + _SF.GetMethod().Name);
            }
            else
            {
                Console.Write("[" + _DTN.ToLongTimeString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
            }

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("> :: ");
            Console.ForegroundColor = colorTwo;
            Console.WriteLine(logText);
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #4
0
파일: IO.cs 프로젝트: ChemicalDries/ExpROSE
        /// <summary>
        /// Prints a customizeable line of log, together with timestamp and title.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        /// <param name="Title">The title of the log.</param>
        public static void Write(string logText, logFlags logFlag, bool debugmode, ConsoleColor colorOne, ConsoleColor colorTwo, string Title)
        {
            if ((int)logFlag < (int)minimumImportance)
                return;

            DateTime _DTN = DateTime.Now;

            if (debugmode == true)
            {
                Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(Title);
            }
            else
            {
                Console.Write("[" + _DTN.ToLongTimeString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(Title);
            }

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("> :: ");
            Console.ForegroundColor = colorTwo;
            Console.Write(logText);
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #5
0
        /// <summary>
        /// Writes a plain text line.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        public static void writePlain(string logText, logFlags flag)
        {
            Writer.WriteLine(logText);
            return;

            //if (flag < minimumImportance)
            //    return;

            //enQueueItem(new PrintItem(logText.Replace(Convert.ToChar(13).ToString(), "{13}"), null, null, null, null, writePlain));
        }
예제 #6
0
        public static void writeError(string logText, logFlags flag)
        {
            if (flag < minimumImportance)
            {
                return;
            }
            DateTime   _DTN = DateTime.Now;
            StackFrame _SF  = new StackTrace().GetFrame(1);

            enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeSpecialColorLine, ConsoleColor.Red, ConsoleColor.DarkRed));
        }
예제 #7
0
        /// <summary>
        /// Writes a special line of log, with customizeable colors and header coloring of logText.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="flag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        /// <param name="headerHead">The string to use infront of logText.</param>
        /// <param name="headerLength">The length of the header to color.</param>
        /// <param name="headerColor">The color for the header in the logText.</param>
        public static void writeSpecialLine(string logText, logFlags flag, ConsoleColor headerColor, ConsoleColor colorTwo, string headerHead)
        {
            Writer.WriteLine(logText);
            return;

            //if (flag < minimumImportance)
            //    return;
            //DateTime _DTN = DateTime.Now;
            //StackFrame _SF = new StackTrace().GetFrame(1);
            //enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeSpecialLineWithHeaderHead, headerColor, colorTwo, headerHead));
        }
예제 #8
0
        /// <summary>
        /// Prints a green line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        public static void writeLine(string logText, logFlags flag)
        {
            Writer.WriteLine(logText);
            return;

            //if (flag < minimumImportance)
            //    return;
            //DateTime _DTN = DateTime.Now;
            //StackFrame _SF = new StackTrace().GetFrame(1);
            //enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeNormal));
        }
예제 #9
0
        /// <summary>
        /// Prints a customizeable line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        public static void writeLine(string logText, logFlags logFlag, ConsoleColor colorOne, ConsoleColor colorTwo)
        {
            Writer.WriteLine(logText);
            return;

            if (logFlag < minimumImportance)
            {
                return;
            }
            DateTime   _DTN = DateTime.Now;
            StackFrame _SF  = new StackTrace().GetFrame(1);

            enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeSpecialColorLine, colorOne, colorTwo));
        }
예제 #10
0
        /// <summary>
        /// Prints a red,error line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this error.</param>
        public static void WriteError(string logText, logFlags logFlag)
        {
            if ((int)logFlag < (int)minimumImportance)
                return;

            DateTime _DTN = DateTime.Now;
            StackFrame _SF = new StackTrace().GetFrame(1);

            Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] [");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("] » ");
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine(logText);
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #11
0
        /// <summary>
        /// Prints a green line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        public static void WriteLine(string logText, logFlags logFlag)
        {
            if ((int)logFlag < (int)minimumImportance)
            {
                return;
            }

            DateTime   _DTN = DateTime.Now;
            StackFrame _SF  = new StackTrace().GetFrame(1);

            Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] [");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("] » ");
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Console.WriteLine(logText);
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #12
0
        /// <summary>
        /// Writes a special line of log, with customizeable colors and header coloring of logText.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        /// <param name="headerHead">The string to use infront of logText.</param>
        /// <param name="headerLength">The length of the header to color.</param>
        /// <param name="headerColor">The color for the header in the logText.</param>
        public static void WriteSpecialLine(string logText, logFlags logFlag, ConsoleColor colorOne, ConsoleColor colorTwo, string headerHead, int headerLength, ConsoleColor headerColor)
        {
            //if ((int)logFlag < (int)minimumImportance)
                //return;

            DateTime _DTN = DateTime.Now;
            StackFrame _SF = new StackTrace().GetFrame(1);
            Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] [");
            Console.ForegroundColor = colorOne;
            Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("] " + headerHead + " ");
            Console.ForegroundColor = headerColor;
            Console.Write(logText.Substring(0, headerLength));
            Console.ForegroundColor = colorTwo;
            Console.WriteLine(logText.Substring(headerLength));
            Console.ForegroundColor = ConsoleColor.Gray;
        }
예제 #13
0
 /// <summary>
 /// Writes a special line of log, with customizeable colors and header coloring of logText.
 /// </summary>
 /// <param name="logText">The log line to be printed.</param>
 /// <param name="logFlag">The importance flag of this log line.</param>
 /// <param name="colorOne">The color to use on the left.</param>
 /// <param name="colorTwo">The color to use on the right.</param>
 /// <param name="headerHead">The string to use infront of logText.</param>
 /// <param name="headerLength">The length of the header to color.</param>
 /// <param name="headerColor">The color for the header in the logText.</param>
 public static void WriteSpecialLine(string logText, logFlags logFlag, ConsoleColor colorOne, ConsoleColor colorTwo, string headerHead, int headerLength, ConsoleColor headerColor)
 {
     wait();
     bwait = true;
     DateTime _DTN = DateTime.Now;
     StackFrame _SF = new StackTrace().GetFrame(1);
     Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] [");
     Console.ForegroundColor = colorOne;
     Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
     Console.ForegroundColor = ConsoleColor.Gray;
     Console.Write("] " + headerHead + " ");
     Console.ForegroundColor = headerColor;
     try { Console.Write(logText.Substring(0, headerLength)); }
     catch { Console.Write(logText); }
     Console.ForegroundColor = colorTwo;
     Console.WriteLine(logText.Substring(headerLength));
     Console.ForegroundColor = ConsoleColor.Gray;
     bwait = false;
 }
예제 #14
0
        /// <summary>
        /// Prints a customizeable line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        public static void writeLine(string logText, logFlags logFlag, ConsoleColor colorOne, ConsoleColor colorTwo)
        {
            Writer.WriteLine(logText);
            return;

            if (logFlag < minimumImportance)
                return;
            DateTime _DTN = DateTime.Now;
            StackFrame _SF = new StackTrace().GetFrame(1);
            enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeSpecialColorLine, colorOne, colorTwo));
        }
예제 #15
0
 /// <summary>
 /// Prints a customizeable line of log, together with timestamp and method name.
 /// </summary>
 /// <param name="logText">The log line to be printed.</param>
 /// <param name="logFlag">The importance flag of this log line.</param>
 /// <param name="colorOne">The color to use on the left.</param>
 /// <param name="colorTwo">The color to use on the right.</param>
 public static void WriteLine(string logText, logFlags logFlag, ConsoleColor colorOne, ConsoleColor colorTwo)
 {
     if ((int)logFlag < (int)minimumImportance)
         return;
     wait();
     bwait = true;
     DateTime _DTN = DateTime.Now;
     StackFrame _SF = new StackTrace().GetFrame(1);
     Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] [");
     Console.ForegroundColor = colorOne;
     Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
     Console.ForegroundColor = ConsoleColor.Gray;
     Console.Write("] » ");
     Console.ForegroundColor = colorTwo;
     Console.WriteLine(logText);
     Console.ForegroundColor = ConsoleColor.Gray;
     bwait = false;
 }
예제 #16
0
파일: Out.cs 프로젝트: habb0/Bfly
        /// <summary>
        /// Writes a special line of log, with customizeable colors and header coloring of logText.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="flag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        /// <param name="headerHead">The string to use infront of logText.</param>
        /// <param name="headerLength">The length of the header to color.</param>
        /// <param name="headerColor">The color for the header in the logText.</param>
        public static void writeSpecialLine(string logText, logFlags flag, ConsoleColor headerColor, ConsoleColor colorTwo, string headerHead)
        {
            Writer.WriteLine(logText);
            return;

            //if (flag < minimumImportance)
            //    return;
            //DateTime _DTN = DateTime.Now;
            //StackFrame _SF = new StackTrace().GetFrame(1);
            //enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeSpecialLineWithHeaderHead, headerColor, colorTwo, headerHead));
        }
예제 #17
0
파일: Out.cs 프로젝트: habb0/Bfly
        /// <summary>
        /// Writes a red line of text
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="flag">The importance flag of this log line.</param>
        public static void writeRedText(string logText, logFlags flag)
        {
            if (flag < minimumImportance)
                return;

            DateTime _DTN = DateTime.Now;
            StackFrame _SF = new StackTrace().GetFrame(1);

            enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeRed));
        }
예제 #18
0
파일: Out.cs 프로젝트: habb0/Bfly
        /// <summary>
        /// Writes a plain text line.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        public static void writePlain(string logText, logFlags flag)
        {
            Writer.WriteLine(logText);
            return;

            //if (flag < minimumImportance)
            //    return;

            //enQueueItem(new PrintItem(logText.Replace(Convert.ToChar(13).ToString(), "{13}"), null, null, null, null, writePlain));
        }
예제 #19
0
파일: Out.cs 프로젝트: habb0/Bfly
        /// <summary>
        /// Prints a green line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        public static void writeLine(string logText, logFlags flag)
        {
            Writer.WriteLine(logText);
            return;

            //if (flag < minimumImportance)
            //    return;
            //DateTime _DTN = DateTime.Now;
            //StackFrame _SF = new StackTrace().GetFrame(1);
            //enQueueItem(new PrintItem(logText, _SF.GetMethod().Name, _SF.GetMethod().ReflectedType.Name, _DTN.ToLongTimeString(), _DTN.Millisecond.ToString(), writeNormal));
        }
예제 #20
0
파일: IO.cs 프로젝트: ChemicalDries/ExpROSE
        /// <summary>
        /// Prints a customizeable line of log, together with timestamp and method name.
        /// </summary>
        /// <param name="logText">The log line to be printed.</param>
        /// <param name="logFlag">The importance flag of this log line.</param>
        /// <param name="colorOne">The color to use on the left.</param>
        /// <param name="colorTwo">The color to use on the right.</param>
        public static void WriteLine(string logText, logFlags logFlag, bool debugmode, ConsoleColor colorOne, ConsoleColor colorTwo)
        {
            if ((int)logFlag < (int)minimumImportance)
                return;

            DateTime _DTN = DateTime.Now;
            StackFrame _SF = new StackTrace().GetFrame(1);

            if (debugmode == true)
            {
                Console.Write("[" + _DTN.ToLongTimeString() + ":" + _DTN.Millisecond.ToString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(_SF.GetMethod().ReflectedType.FullName + "." + _SF.GetMethod().Name);
            }
            else
            {
                Console.Write("[" + _DTN.ToLongTimeString() + "] <");
                Console.ForegroundColor = colorOne;
                Console.Write(_SF.GetMethod().ReflectedType.Name + "." + _SF.GetMethod().Name);
            }

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("> :: ");
            Console.ForegroundColor = colorTwo;
            Console.WriteLine(logText);
            Console.ForegroundColor = ConsoleColor.Gray;
        }