17 using System.Globalization;
27 private const string DefaultDateFormat =
"yyyyMMdd HH:mm:ss.fff";
28 private readonly TextWriter _trace;
29 private readonly TextWriter _error;
30 private readonly
string _dateFormat;
36 : this(DefaultDateFormat)
49 _error = Console.Error;
50 _dateFormat = dateFormat;
57 public virtual void Error(
string text)
60 Console.ForegroundColor = ConsoleColor.Red;
62 _error.WriteLine($
"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} ERROR:: {text}");
72 public virtual void Debug(
string text)
74 _trace.WriteLine($
"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} DEBUG:: {text}");
81 public virtual void Trace(
string text)
83 _trace.WriteLine($
"{DateTime.UtcNow.ToString(_dateFormat, CultureInfo.InvariantCulture)} TRACE:: {text}");