public static void WriteLine(string line, string colorHex, bool dontHttpEncode = false) { if (!colorHex.StartsWith("#")) { colorHex = "#" + colorHex; } DateTime now = DateTime.Now; string output = "[" + now.ToString() + "] " + line; string htmlOutput = ""; if (dontHttpEncode) { htmlOutput = "[" + now.ToString() + "] <span style=\"color=" + colorHex + "\">" + line + "</span>"; } else { htmlOutput = "[" + now.ToString() + "] <span style=\"color=" + colorHex + "\">" + System.Web.HttpUtility.HtmlEncode(line) + "</span>"; } OnWriteLine?.Invoke(htmlOutput, true); Console.WriteLine(output); LogsManager.Instance.WriteLine(output); }
public void PrintLine(string line) { UpdateTime(); sw.WriteLine(timestamp + line); sw.Flush(); OnWriteLine?.Invoke(timestamp, line); }
public static void WriteLine(string line, bool dontHttpEncode = false) { DateTime now = DateTime.Now; string output = "[" + now.ToString() + "] " + line; OnWriteLine?.Invoke(output, dontHttpEncode); Console.WriteLine(output); LogsManager.Instance.WriteLine(output); }
private static void GenericLogger_OnWriteLine(string line, string context) { string msg = string.Format( "{0}\t{1}>\t{2}", DateTime.Now.ToTimeStampString(), context, line ); TestContext.Out.Write(msg); TestContext.Out.Flush(); Debug.Write(msg); OnWriteLine?.Invoke(msg); }
public static void WriteLine(string message) { Console.WriteLine("[LOG] " + message); OnWriteLine?.Invoke(message); }
public DomainOutput WriteLine(object value, ConsoleColor color) { OnWriteLine?.Invoke(value, color); return(this); }
void IWrite.WriteLine(object value, ConsoleColor color) { OnWriteLine?.Invoke(value, color); }
public DomainOutput WriteLine(string text, ConsoleColor color) { OnWriteLine?.Invoke(text, color); return(this); }
void IWrite.WriteLine(string text, ConsoleColor color) { OnWriteLine?.Invoke(text, color); }
/// <summary> /// Calls the <see cref="OnWriteLine"/> /// </summary> /// <param name="value">The string to write.</param> public override void WriteLine(string value) { OnWriteLine?.Invoke(this, new TextWriterEventArgs(value)); }
public IWriteAnsi WriteLine(object value, ConsoleColor color) { OnWriteLine?.Invoke(value, color); return(this); }
public IWriteAnsi WriteLine(string text, ConsoleColor color) { OnWriteLine?.Invoke(text, color); return(this); }