mono/mono — pull request #1267 by ramtinkermani (2014-09-09 21:13:03+00:00)
Title: The ShouldTrace method's conditions are fixed to correctly trace the events based...

The ShouldTrace method's conditions are fixed to correctly trace the events based on the Level.

Keeping in mind the values for SourceLevel enum:
public enum SourceLevels
{
Off = 0,
Critical = 1,
Error = 3,
Warning = 7,
Information = 15,
Verbose = 31,
[EditorBrowsable (EditorBrowsableState.Advanced)]
ActivityTracing = 0xFF00,
All = -1,
}

and the values for TraceEventType:
public enum TraceEventType
{
Critical = 1,
Error = 2,
Warning = 4,
Information = 8,
Verbose = 16,
[EditorBrowsable (EditorBrowsableState.Advanced)]
Start = 0x100,
[EditorBrowsable (EditorBrowsableState.Advanced)]
Stop = 0x200,
[EditorBrowsable (EditorBrowsableState.Advanced)]
Suspend = 0x400,
[EditorBrowsable (EditorBrowsableState.Advanced)]
Resume = 0x800,
[EditorBrowsable (EditorBrowsableState.Advanced)]
Transfer = 0x1000,
}

and simply computing the results of AND operations, you see that now the right Boolean value is returned. I also wrote unit tests for it but don't know how to include it here!