We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c52d235 commit dbb2291Copy full SHA for dbb2291
flow/scripts/util.tcl
@@ -1,11 +1,14 @@
1
proc log_cmd {cmd args} {
2
# log the command, escape arguments with spaces
3
- puts -nonewline "$cmd[join [lmap arg $args {format " %s" [expr {[string match {* *} $arg] ? "\"$arg\"" : "$arg"}]}] ""]"
+ set log_cmd "$cmd[join [lmap arg $args {format " %s" [expr {[string match {* *} $arg] ? "\"$arg\"" : "$arg"}]}] ""]"
4
+ puts $log_cmd
5
set start [clock seconds]
6
$cmd {*}$args
7
set time [expr {[clock seconds] - $start}]
8
if {$time >= 5} {
- puts -nonewline " ($time seconds)"
9
+ # Ideally we'd use a single line, but the command can output text
10
+ # and we don't want to mix it with the log, so output the time it took afterwards.
11
+ puts "Took $time seconds: $log_cmd"
12
}
13
puts ""
14
0 commit comments