aboutsummaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl15
1 files changed, 12 insertions, 3 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index c49ac19..c389e17 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -308,10 +308,19 @@ proc grade_Category2html_name { category } {
return $html_name
}
-proc dbg {msg {level 1}} {
- if { $level <=2 } {
+proc dbg {msg {category msg_level_critical}} {
+ switch $category {
+ msg_level_info {set msg_header "Info:"; set level 6}
+ msg_level_warning {set msg_header "Warning:"; set level 4}
+ msg_level_dbg {set msg_header "Debug:"; set level 3}
+ msg_level_log {set msg_header "Log:"; set level 2}
+ msg_level_critical {set msg_header "Error:"; set level 1}
+ default {set msg_header "Unknown:"; set level 0}
+ }
+
+ if { $level <=4 } {
set fid [open log a+]
- puts $fid $msg
+ puts $fid "$msg_header $msg"
close $fid
}
}