chiark / gitweb /
Add optional logging of subprocess execution
authorKarl Hasselström <kha@treskal.com>
Sun, 26 Aug 2007 20:04:10 +0000 (22:04 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 29 Aug 2007 10:52:59 +0000 (11:52 +0100)
commit7748ec707072ac014a106bdb56f8517d1f9a8915
tree2152edd211b5b8f3e40b004b34336aa81f7080ac
parent06104c208673fdfdbcc320d59e8fb9658330edc3
Add optional logging of subprocess execution

Now that the subprocess calling has been refactored and is in a nice
shape, it's quite simple to add some logging facilities. This patch
adds two separate log modes, switched by the STG_SUBPROCESS_LOG
environment variable:

  * Setting it to "debug" prints the executable name and all
    arguments, and the subprocess return value.

  * Setting it to "profile" prints just the executable name, and the
    (wallclock) time elapsed during the call.

  * Not setting it will disable logging, of course.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/run.py