summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-misc.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-02-28 13:22:21 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-02-28 13:22:21 +0100
commit8be65c346aa8ca9c7650f935ad608a82250d9a0d (patch)
treeadc275b4254deff5f8c5fdf57593633636fac8a4 /src/core/libs/lib-misc.sh
parenta3fe8a1317794b5ca644a12c45d3f98788b10a9d (diff)
support for debug categories
Diffstat (limited to 'src/core/libs/lib-misc.sh')
-rw-r--r--src/core/libs/lib-misc.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index ac66bd1..97252b9 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -12,16 +12,16 @@ run_background ()
[ -z "$2" ] && die_error "run_background needs a command to execute!"
[ -z "$3" ] && die_error "run_background needs a logfile to redirect output to!"
- debug "run_background called. identifier: $1, command: $2, logfile: $3"
+ debug 'MISC' "run_background called. identifier: $1, command: $2, logfile: $3"
( \
touch $RUNTIME_DIR/aif-$1-running
- debug "run_background starting $1: $2 >>$3 2>&1"
+ debug 'MISC' "run_background starting $1: $2 >>$3 2>&1"
[ -f $3 ] && echo -e "\n\n\n" >>$3
echo "STARTING $1 . Executing $2 >>$3 2>&1\n" >> $3;
var_exit=${1}_exitcode
eval "$2" >>$3 2>&1
read $var_exit <<< $? #TODO: bash complains about 'not a valid identifier'
- debug "run_background done with $1: exitcode (\$$1_exitcode): "${!var_exit}" .Logfile $3" #TODO ${!var_exit} doesn't show anything --> maybe fixed now
+ debug 'MISC' "run_background done with $1: exitcode (\$$1_exitcode): ${!var_exit} .Logfile $3" #TODO ${!var_exit} doesn't show anything --> maybe fixed now
echo >> $3
rm -f $RUNTIME_DIR/aif-$1-running
) &
@@ -50,7 +50,7 @@ wait_for ()
# $2 needle
check_is_in ()
{
- [ -z "$1" ] && debug "check_is_in $1 $2" && die_error "check_is_in needs a non-empty needle as \$2 and a haystack as \$1!" # haystack can be empty though
+ [ -z "$1" ] && debug 'MISC' "check_is_in $1 $2" && die_error "check_is_in needs a non-empty needle as \$2 and a haystack as \$1!" # haystack can be empty though
local pattern="$1" element
shift