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(+)
This commit is contained in:
Yann E. MORIN" 2008-05-25 22:25:50 +00:00
parent 3d9cc3d036
commit 91c6e16780

View File

@ -105,6 +105,14 @@ CT_DoLog() {
return 0
}
# Execute an action, and log its messages
# Usage: CT_DoExecLog <level> <[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 <level>
CT_DoEnd()