Auditing library is a small piece of code that allows logging events, describing their level, dumping stack and many other things that can really be useful when debugging an application.
For now only a small demonstration is available:
# small audit example
package require audit::audit
audit::configure -level 9 -logfile audit.txt -datafile audit.aud
# just log that we're initializing
audit::audit someType 3 "Initializing application"
set var1 1
set var2(2) 1234
# log an error + contents of variables var1 and var2
audit::audit someType 1 "Error message" {var1 var2}
# log an error + some other information (as name-value pairs)
if {[catch {
set fh [open /path/to/file.xml]
} err]} {
audit::audit someType 1 "Cannot open file: $err" {} \
errorInfo $::errorInfo errorCode $::errorCode
}