24 using System.Collections.Generic;
26 namespace Ntp.Common.Log
33 activity =
new List<string>(2001);
37 private readonly
object locker =
new object();
41 return activity.GetEnumerator();
44 IEnumerator IEnumerable.GetEnumerator()
46 return activity.GetEnumerator();
95 throw new ArgumentOutOfRangeException(nameof(severity));
98 var now = DateTime.Now;
99 string entry =
string.Concat(
100 now.ToString(
"HH:mm:ss"),
101 " ", severityText,
" ",
106 if (activity.Count == 1000)
107 activity.RemoveAt(0);
115 WriteLine(exception.Message,
Severity.Error);
116 WriteLine(exception.StackTrace,
Severity.Debug);
124 WriteLine(exception.Message, severity);
125 WriteLine(exception.StackTrace, severity);
readonly List< string > activity
override void WriteLine(Exception exception)
override void WriteLine(string text, Severity severity)
override void Initialize()
override void WriteLine(Exception exception, Severity severity)
IEnumerator< string > GetEnumerator()