Log4PostSharp 1.0.1(herrmic-coding.blogspot.com)
submitted by
markell(5) 3 years, 2 months ago
Hi Michal. This comes as a real help and huge thanks to you.
I have made little additions to your code, namely:
1. Added {method}, {inparamvalues} and {outparamvalues} templates.
2. Only string parameter values are quoted.
3. Added LogAttribute.IncludeParamNames, which when set causes parameters to be logged with their respective names.
I would like to send you the diffs, if you do not mind, to get any feedback. I am sure it will be valuable.
There are a few more things I wanted to do, but unfortunately code weaving is still a mistery for me.
Specifically, I think there should be a way to tell the LogAttribute how ToString the parameter values. I mean, the default implementation of ToString in list types is not much useful. Something, like LogConfigAttribute, which could be given various configuration options, one of which could be the location of the custom ToString procedure.
This way, we get two goals achieved:
1. Customized ToString
2. No boxing during object[] parameters array creation.
Another thing, is that the injected code is always inside the respective isXXXEnabled if statement. But, it is only needed if we actually create the object[] parameters array. In all other cases, we just pay for this extra check.
I would really like to hear your opinion.
Again, thanks for the great work.
|category: C#
|Views: 10
tags:
C# another
Everyones tags:
Your Tags: