Created
December 6, 2018 13:12
-
-
Save chrisnas/26f2476b9ae2d4bbe8ae26880208afd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://blogs.msdn.microsoft.com/dotnet/2018/12/04/announcing-net-core-2-2/ | |
// Called whenever an event is written. | |
protected override void OnEventWritten(EventWrittenEventArgs eventData) | |
{ | |
// Write the contents of the event to the console. | |
Console.WriteLine($"ThreadID = {eventData.OSThreadId} ID = {eventData.EventId} Name = {eventData.EventName}"); | |
for (int i = 0; i < eventData.Payload.Count; i++) | |
{ | |
string payloadString = eventData.Payload[i] != null ? eventData.Payload[i].ToString() : string.Empty; | |
Console.WriteLine($" Name = \"{eventData.PayloadNames[i]}\" Value = \"{payloadString}\""); | |
} | |
Console.WriteLine("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment