jonwagner / EventSourceProxy

EventSourceProxy (ESP) is the easiest way to add scalable Event Tracing for Windows (ETW) logging to your .NET program
Other
97 stars 20 forks source link

Change the name of TracingProxy generated EventSource #35

Closed ibebbs closed 9 years ago

ibebbs commented 9 years ago

Hi John,

Still loving EventSourceProxy; I'm using it all over the place.

One question, is it possible to change the event source name of an event source generated by the TracingProxy? Ideally something along the lines of [EventSourceImplementation(Name = "<name>")] but without having to attribute the interface being proxied (i.e. if it is from a third party).

Something along the lines of: TracingProxy.CreateWithActivityScope<ICalculator>(new Calculator(), "MyProxiedCalculator") (where 'MyProxiedCalculator' is the new event source name) would be great.

Cheers, Ian

jonwagner commented 9 years ago

That probably wouldn't be too hard.

One thing you ca try right now is deriving your own interface:

[attribute] interface IMyInterface : ITheirInterface {}

If the interface isn't sealed, this will probably work for you.

ibebbs commented 9 years ago

Ha, cunning. Yes, that'd work but does increase the ceremony around it.

I'll have a look at running with that for now.

Cheers Jon.

On Mon, Jan 26, 2015 at 1:11 PM, Jon Wagner notifications@github.com wrote:

That probably wouldn't be too hard.

One thing you ca try right now is deriving your own interface:

[attribute] interface IMyInterface : ITheirInterface {}

If the interface isn't sealed, this will probably work for you.

— Reply to this email directly or view it on GitHub https://github.com/jonwagner/EventSourceProxy/issues/35#issuecomment-71458234 .

jonwagner commented 9 years ago

In v3.0.4, you can now do:

EventSourceImplementationAttribute.For<IHateThisName>(new EventSourceImplementationAttribute() { Name = "A Better Name" });
ibebbs commented 9 years ago

Looks great Jon. I'll give it a shot when I get back to work!