/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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)); }
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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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)); }
/// <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; }
/// <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)); }
/// <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; }