From de7c6d7d956e7ccbbde584a90ba6e55fb2728287 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 9 Dec 2008 17:32:20 +0100 Subject: implementation of LOG_TO_FILE 1/0, dont send log/debug to tty1. in some cases use exit instead of stop_installer + 2 small fixes --- src/core/libs/lib-ui.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core/libs/lib-ui.sh') diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index f056583..6275540 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -14,7 +14,7 @@ DIA_MENU_TEXT="Use the UP and DOWN arrows to navigate menus. Use TAB to switch # display error message and die die_error () { - [ -n "$LOGFILE" ] && debug "die_error: ERROR: $@" > $LOGFILE + debug "die_error: ERROR: $@" notify "ERROR: $@" exit 2 } @@ -38,7 +38,7 @@ show_warning () else echo "WARNING: $1" [ "${type}" = msg ] && echo -e "$2" - [ "${type}" = text ] && cat $2 || die_error "Could not cat $2" + [ "${type}" = text ] && (cat $2 || die_error "Could not cat $2") fi return 0 @@ -79,10 +79,10 @@ log () then echo -e "$str" >$LOG else - echo -e "$str" + echo -e "$str" >$LOG fi - echo -e "$str" >> $LOGFILE + [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE } @@ -95,9 +95,9 @@ debug () then echo -e "$str" > $LOG else - echo -e "$str" + echo -e "$str" > $LOG fi - echo -e "$str" >> $LOGFILE + [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE fi } -- cgit v1.2.3-54-g00ecf