################################################################# # putsLog with timestamp. #################################################################### #proc putsLog { a } { # # global AdminControl # # # #set host [ info host ] # # set host [ $AdminControl getHost ] # #set node [ $AdminControl getNode ] # # set compTime [clock format [clock seconds] -format "%Y-%m-%d-%H.%M.%S"] # # #puts "\[$host\]:\[$node\]:\[$compTime\] $a" # puts "\[$host\]:\[$compTime\] $a" # #} ################################################################# # putsLog with timestamp. #################################################################### proc putsLog { a { channel stdout } } { global env set procName [ lindex [ info level 0 ] 0 ] set argsList [ info args $procName ] # if argument count = 1 then put to standard out. # if argument count = 2 then put to standard out and the other channel. # if the channel argument is not supplied it defaults to stdout. set host [ info host ] set compTime [clock format [clock seconds] -format "%Y-%m-%d-%H.%M.%S"] if { $channel != "stdout" } { puts $channel "\[$host\]:\[$compTime\] $a" } puts stdout "\[$host\]:\[$compTime\] $a" }