Skip to content

Commit

Permalink
Merge pull request #432 from Andne/use-stderr
Browse files Browse the repository at this point in the history
Error output and logviewer improvements
  • Loading branch information
niXman committed Jan 29, 2017
2 parents 63f51ff + 3cb4df4 commit 0fdcd00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ readonly RUN_ARGS="$@"
echo " --show-subtargets - show list of subtargets for selected '--mode'"
echo " --short-output - reduce output by not printing skipped subtargets"
echo " --logviewer-command - use this command for the log viewer"
echo " --wait-for-logviewer - wait until after logviewer completes, e.g. for echo"
echo " available Python versions: 2, 3"
echo " available clang versions: 3.4, git"
echo " available gcc versions:"
Expand Down Expand Up @@ -277,6 +278,7 @@ while [[ $# > 0 ]]; do
--debug-upload) DEBUG_UPLOAD=yes ;;
--short-output) SHORT_OUTPUT=yes ;;
--logviewer-command=*) LOGVIEWER=${1/--logviewer-command=/} ;;
--wait-for-logviewer) LOGVIEWER_WAIT=yes ;;
*)
die "bad command line: \"$1\". terminate."
;;
Expand Down
1 change: 1 addition & 0 deletions library/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ echo "done"
# **************************************************************************

LOGVIEWER=
LOGVIEWER_WAIT=no

func_find_logviewer \
LOGVIEWERS[@] \
Expand Down
11 changes: 9 additions & 2 deletions library/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,20 @@ function die {
# $2 - exit code
local _retcode=1
[[ -n $2 ]] && _retcode=$2
echo $1
echo
>&2 echo $1
exit $_retcode
}

function func_show_log {
# $1 - log file
[[ $SHOW_LOG_ON_ERROR == yes ]] && $LOGVIEWER $1 &
[[ $SHOW_LOG_ON_ERROR == yes ]] && {
[[ $LOGVIEWER_WAIT == yes ]] && {
$LOGVIEWER $1
} || {
$LOGVIEWER $1 &
}
}
}

# **************************************************************************
Expand Down

0 comments on commit 0fdcd00

Please sign in to comment.