Check out the codes in GitHub.
Basically, 2 steps:
Create a C++ Windows Runtime Component (dll) that will use the ETW header file.
Reference the WinRT DLL to C# project.
WinRT DLL
My logging class looks like this:
And heres the implementation:
Wrapper Class
Just like in part 5, I wrapped the C++ bits to a C# class so I can use the CallerMemberName
and CallerFilePath
attributes:
And finally, the actual logging in C#:
---
If you have any questions or feedback, please reach out
@flowerinthenyt.