17 using System.Collections.Concurrent;
18 using System.Globalization;
28 private readonly ConcurrentQueue<LogEntry> _logs;
29 private const string DateFormat =
"yyyyMMdd HH:mm:ss";
30 private readonly TextWriter _trace;
31 private readonly TextWriter _error;
36 public ConcurrentQueue<LogEntry>
Logs
56 _logs =
new ConcurrentQueue<LogEntry>();
58 _error = Console.Error;
71 Console.ForegroundColor = ConsoleColor.Red;
72 _error.WriteLine(DateTime.Now.ToString(
DateFormat, CultureInfo.InvariantCulture) +
" Error:: " + text);
86 _trace.WriteLine(DateTime.Now.ToString(
DateFormat, CultureInfo.InvariantCulture) +
" Debug:: " + text);
99 _trace.WriteLine(DateTime.Now.ToString(
DateFormat, CultureInfo.InvariantCulture) +
" Trace:: " + text);