# HG changeset patch # User "Yann E. MORIN" # Date 1211754350 0 # Node ID 1035cecf385068f5615ae13b4759a30fa2384925 # Parent 7eaad7396b66893d908e5352bb1d820ebd977207 Add a new helper function: CT_DoExecLog. It is similar to CT_DoLog, but instead of printing its arguments, it uses them as a command, and logs the output of that command. /trunk/scripts/functions | 8 8 0 0 ++++++++ 1 file changed, 8 insertions(+) diff -r 7eaad7396b66 -r 1035cecf3850 scripts/functions --- a/scripts/functions Sun May 25 22:23:29 2008 +0000 +++ b/scripts/functions Sun May 25 22:25:50 2008 +0000 @@ -105,6 +105,14 @@ return 0 } +# Execute an action, and log its messages +# Usage: CT_DoExecLog <[VAR=val...] command [parameters...]> +CT_DoExecLog() { + local level="$1" + shift + eval "$@" 2>&1 |CT_DoLog "${level}" +} + # Tail message to be logged whatever happens # Usage: CT_DoEnd CT_DoEnd()