aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-01-21 15:23:03 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2012-01-21 15:23:03 -0500
commitd5941a5a42beaff9ecae4bae8c8d4e57b94a8cbe (patch)
treebc1ad63f6a795513f4af8ed00785ca735948d50d
parent5d2b13c7329383fe10366e1b68a24fb8e5d49df3 (diff)
downloadGradeBook-d5941a5a42beaff9ecae4bae8c8d4e57b94a8cbe.tar.gz
GradeBook-d5941a5a42beaff9ecae4bae8c8d4e57b94a8cbe.zip
dbg proc modified
-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
}
}