I'm currently experimenting with Microsoft EventSources in C #. One limitation is the following
... The number and types of arguments passed to the ETW method must exactly match the types passed in the WriteEvent call that it calls. For instance:
[Event(2, Level = EventLevel.Informational)] public void Info(string message, int count) { base.WriteEvent(2, message, count); }
This basically limits the ability to write a richer API in the EventSource class. This basically means that you cannot create a method that receives a custom object, and inside the body of the method you can serialize it to a string (or another type supported by WriteEvent overloads).
The only thing you can decide is the name of the method and the parameters and counts that reflect the WriteEvent overload. Or am I wrong?
source share