Skip to content

Continuous recording of in-process event sources. Useful for logging last events before an exception, e.g. unhandled top level exceptions.

License

Notifications You must be signed in to change notification settings

Observito/EventSourceFlightRecorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EventSourceFlightRecorder

Continuous recording of in-process event sources. Useful for logging last events before an exception, e.g. unhandled top level exceptions.

Sample

using var recorder = new EventSourceFlightRecorder<string>(100);

recorder.EnableEvents(EchoEventSource.Log, EventLevel.Informational, ev => $"[{ev.TimeStamp:yyyy-MM-dd HH:mm:ss.ffff}] {ev.EventSource.Name}/{ev.EventName}/{ev.Opcode}: { EventFormatting.FormatMessage(ev)}");

// ... later ...

foreach (var ev in recorder.Snapshot)
    Console.WriteLine($"- {ev}");

About

Continuous recording of in-process event sources. Useful for logging last events before an exception, e.g. unhandled top level exceptions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages