Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public void PrintLine(string line)
 {
     UpdateTime();
     sw.WriteLine(timestamp + line);
     sw.Flush();
     OnWriteLine?.Invoke(timestamp, line);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public static void WriteLine(string message)
 {
     Console.WriteLine("[LOG] " + message);
     OnWriteLine?.Invoke(message);
 }
Exemplo n.º 6
0
 public DomainOutput WriteLine(object value, ConsoleColor color)
 {
     OnWriteLine?.Invoke(value, color);
     return(this);
 }
Exemplo n.º 7
0
 void IWrite.WriteLine(object value, ConsoleColor color)
 {
     OnWriteLine?.Invoke(value, color);
 }
Exemplo n.º 8
0
 public DomainOutput WriteLine(string text, ConsoleColor color)
 {
     OnWriteLine?.Invoke(text, color);
     return(this);
 }
Exemplo n.º 9
0
 void IWrite.WriteLine(string text, ConsoleColor color)
 {
     OnWriteLine?.Invoke(text, color);
 }
Exemplo n.º 10
0
 /// <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));
 }
Exemplo n.º 11
0
 public IWriteAnsi WriteLine(object value, ConsoleColor color)
 {
     OnWriteLine?.Invoke(value, color);
     return(this);
 }
Exemplo n.º 12
0
 public IWriteAnsi WriteLine(string text, ConsoleColor color)
 {
     OnWriteLine?.Invoke(text, color);
     return(this);
 }