Logging changes.

This commit is contained in:
2025-04-10 22:32:10 -04:00
parent f9365049e2
commit 98cab516fb
5 changed files with 235 additions and 90 deletions

View File

@@ -62,8 +62,8 @@ namespace MarketData.Helper
{
ManualResetEvent[] busyEvents=GetBusyEvents(events);
if(busyEvents.Length!=0)
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Resizing event queue to {0}",busyEvents.Length));
{ // The following trace will skip 3 frames to show the caller of this method in the log
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Resizing event queue to {0}",busyEvents.Length),3);
ManualResetEvent[] resizedEvents=new ManualResetEvent[busyEvents.Length];
Array.Copy(busyEvents, resizedEvents, busyEvents.Length);
return resizedEvents;
@@ -77,12 +77,12 @@ namespace MarketData.Helper
for (int index = 0; index < resetEvents.Length; index++)
{
if (!resetEvents[index].WaitOne(0))
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Event {0} is still doing work",resetEvents[index].SafeWaitHandle.DangerousGetHandle().ToString()));
{ // Notice the magic number 3 at the end of the trace. The is the skip frames because we want the caller of this method to show up in the log
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Event {0} is still doing work",resetEvents[index].SafeWaitHandle.DangerousGetHandle().ToString()),3);
availableEvents.Add(resetEvents[index]);
}
}
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("The event queue has {0} busy slots",availableEvents.Count));
} // The following trace will skip 3 frames to show the caller of this method in the log
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("The event queue has {0} busy slots",availableEvents.Count),3);
return availableEvents.ToArray();
}
@@ -92,8 +92,8 @@ namespace MarketData.Helper
for (int index = 0; index < resetEvents.Length; index++)
{
if (resetEvents[index].WaitOne(0))
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Event {0} is available for work",resetEvents[index].SafeWaitHandle.DangerousGetHandle().ToString()));
{ // @ the end of this trace notice the magic number 3. This is the skip frames for the stack trace. We want the caller of this method to show up in the log
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Event {0} is available for work",resetEvents[index].SafeWaitHandle.DangerousGetHandle().ToString()),3);
availableEvents.Add(resetEvents[index]);
}
}