A Tracer outputs trace messages useful for debugging.
Methods
|
|
GetThreshold
SetThreshold
Write
__init__
|
|
GetThreshold
|
GetThreshold ( self, category )
Return the current threshold for category .
-
category
- A string giving a trace category.
- returns
- The threshold associated with
category . If no
threshold has been set, the threshold is considered to be
zero.
|
|
SetThreshold
|
SetThreshold (
self,
category,
level,
)
Set the threshold associated with category .
category --A string giving a trace category.
-
level
- A non-negative integer indicating the threshold
level for
category .
|
|
Write
|
Write (
self,
message,
category,
level=0,
)
Output a trace message.
-
message
- A string giving the contents of the message. The
message should begin with a capital letter and end with a
period.
-
category
- A string indicating the category to which this
message belongs.
-
level
- A non-negative integer indicating the level at
which the message should be output.
Every category has an associated threshold. If the level of
the message is less than the threshold, the mesage will be
output.
|
|
__init__
|
__init__ ( self, file=sys.stderr )
Construct a new Tracer .
-
file
- The file object to which output should be written.
|
|