summaryrefslogtreecommitdiff
path: root/src/aif.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-03-01 18:07:10 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-03-01 18:07:10 +0100
commite9804d56dc5bea86357905f73d093079d515fdd4 (patch)
tree061a8cb2a45a4cf3d94342d98eae7fa3ee604dce /src/aif.sh
parent5a85a22447954cff0ee8b30db4c04e5a7f8b77fc (diff)
better error handling in log/debug functions
Diffstat (limited to 'src/aif.sh')
-rwxr-xr-xsrc/aif.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/aif.sh b/src/aif.sh
index 54ed0a7..9c9b84e 100755
--- a/src/aif.sh
+++ b/src/aif.sh
@@ -57,8 +57,8 @@ log ()
{
mkdir -p $LOG_DIR || die_error "Cannot create log directory"
str="[LOG] `date +"%Y-%m-%d %H:%M:%S"` $@"
- echo -e "$str" > $LOG
- [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE
+ echo -e "$str" > $LOG || die_error "Cannot log $str to $LOG"
+ [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE || die_error "Cannot log $str to $LOGFILE"
}
# $1 = category. one of MAIN, PROCEDURE, UI, UI-INTERACTIVE, FS, MISC, NETWORK, PACMAN, SOFTWARE
@@ -72,8 +72,8 @@ debug ()
if [ "$DEBUG" = "1" ]
then
str="[DEBUG $1 ] $2"
- echo -e "$str" > $LOG
- [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE
+ echo -e "$str" > $LOG || die_error "Cannot debug $str to $LOG"
+ [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE || die_error "Cannot debug $str to $LOGFILE"
fi
}