namespace eval ::tis {
namespace eval trace {
Proc Really.
This is the proc that gets invoked to really do the tracing.
Arguments:
- msg - Message to be sent to screen.
Returns:
- Empty.
Side effects:
- Prints to the screen.
Notes:
- It will decorate the message a bit.
proc Really {msg} {
set level [expr {[info level]-1}]
set decoLen [string length $msg]
if {$decoLen >= 68} {
set decoLen 68
}
puts [string repeat "+" $decoLen]
puts "LEVEL = $level"
puts $msg
puts [string repeat "-" $decoLen]
return
}
Proc on.
Activates the invokations to proc do.
Arguments:
- None.
Returns:
- Empty.
Side effects:
- Defines the proc ::tis::trace::do.
proc on {} {
proc ::tis::trace::do {args} {
return [::tis::trace::Really {*}$args]
}
return
}
Proc off.
Deactivates the invokations to proc do.
Arguments:
- None.
Returns:
- Empty.
Side effects:
- Defines the proc ::tis::trace::do.
proc off {} {
proc ::tis::trace::do {args} {}
return
}
Proc boot.
Sets up the tracing subsystem in tis.
Arguments:
- None.
Returns:
- Empty.
Side effects:
- Deactivates invokations to ::tis::trace::do.
- Defines yes (trace) and no (no trace) procs.
Notes:
- This gets invoked when loading the package.
proc boot {} {
off
proc ::tis::trace::yes {args} {
return [::tis::trace::Really {*}$args]
}
proc ::tis::trace::no {args} {}
return
}
}
}