Skip to content

Instantly share code, notes, and snippets.

@jamerfort
Created September 13, 2012 23:35
Show Gist options
  • Save jamerfort/3718595 to your computer and use it in GitHub Desktop.
Save jamerfort/3718595 to your computer and use it in GitHub Desktop.
List all the "Error Msg:" stats for each thread in the current site.
# Usage:
# hcitcl error_msgs.tcl
msiAttach
# get a list of threads
set threads [msiTocEntry]
set len [llength $threads]
# loop through each thread
for { set i 0 } { $i < $len } {incr i} {
set thread_name [lindex $threads $i]
# get this thread's stats
set stats [msiGetStatSample $i]
# look for the "PLASTERRTEXT" key in the stats
if { [lsearch [keylkeys stats] PLASTERRTEXT] != -1 } {
set lastmsg [keylget stats PLASTERRTEXT]
if { $lastmsg != "" } {
puts "$thread_name: $lastmsg"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment