From d5941a5a42beaff9ecae4bae8c8d4e57b94a8cbe Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Sat, 21 Jan 2012 15:23:03 -0500 Subject: dbg proc modified --- GradeBook_lib.tcl | 15 ++++++++++++--- 1 file 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 } } -- cgit v1.2.3