After reading the PostSharp documentation it seems that the solution is to annotate the method with the aspect attribute and then Specify AttributeReplace = true. Here is a complete solution to my question.
Let's suppose I defined a logging aspect in a class named LoggingAspectAttribute that gets a TraceLevel on the constructor. On AssemblyInfo.cs I add the following definition:
[assembly: TracingAspect(TraceLevel.Info,
AttributeTargetTypes = "PostSharp2.*",
AttributeTargetTypeAttributes = MulticastAttributes.Public,
AttributeTargetMemberAttributes = MulticastAttributes.Private | MulticastAttributes.Public)]
PostSharp2 is just the name of the assembly I used to test my solution. This definition causes all my traces to be with the Information TraceLevel.
To override this definition I do the following:
[TracingAspect(TraceLevel.Warning, AttributeReplace = true)]
private static void Bar()
{
Console.WriteLine("Inside Bar");
}
This causes the trace message for Bar to be with the Warning TraceLevel and all other messages remain with the Information trace level.
Now, if I will omit the AttributeReplace property and leave the attribute annotation as follows:
[TracingAspect(TraceLevel.Warning)]
private static void Bar()
{
Console.WriteLine("Inside Bar");
}
I will see 2 trace messages from Bar. One with an Information level and another with a warning level.
Hope that helps somebody.