isTraceEnabled()

Compares the specified trace level with the current trace level of the map.

Syntax

Boolean isTraceEnabled(int traceLevel)
 

Parameters

traceLevel
The trace level to compare with the current trace level.

Return values

Returns true if the current system trace level is set to the specified trace level; returns false if the two trace levels are not the same.

Notes

The isTraceEnabled() method is useful in determining whether or not to log a trace message. Because tracing can decrease performance, this method is useful in the development phase of a project.

Examples

if ( isTraceEnabled(3) )
    {
    trace("Print this level-3 trace message");
    }
 

Copyright IBM Corp. 1997, 2003