We have a project where we're using PostSharp to enable logging. Works great. However, there are a couple of methods that are run in very tight loops, where the overhead of logging really adds up to a considerable amount. I'm trying to figure out the best way to exclude them from the logging code.
From what I've read, this approach should work
AssemblyInfo.cs
// turn on logging for all methods in all classes
[assembly: Log(LogType.Debug)]
Code.cs
// exclude this specific method
[Log(AttributeExclude=true)]
private void SomeMethod(...)
However, when I do this and run it with a profiler, I still see the log code being executed on SomeMethod(). I've tried many different iterations of this based on posts on SO and the PostSharp forums, and I always get the same result.
It feels like this should be really simple, and I'm just missing something blatantly obvious.