June 2002
Intermediate to advanced
864 pages
18h 35m
English
Switches give you finer grain control over the diagnostic output. You can use the BooleanSwitch class to turn output on or off based on the value of its Enabled property.
The TraceSwitch class gives you five hierarchical levels of control for its Level property: TraceError, TraceWarning, TraceInfo, TraceVerbose, and Off. These values are part of the TraceLevelEnumeration. Setting a lower Trace level means that the higher ones are set as well. For example, if the TraceWarning level is set, both the TraceError and TraceWarning levels are enabled.
DebugBooleanSwitch.Enabled = True Debug.WriteLineIf(DebugBooleanSwitch.Enabled, _ "Debug Boolean Switch enabled!") ... Trace.WriteLineIf(TraceLevelSwitch.TraceError, ...
Read now
Unlock full access