Merge pull request #112 from opencultureconsulting/45-run-server-log-in-error-msg
run: print 50 lines of server log
This commit is contained in:
commit
9ba1c7f067
10
orcli
10
orcli
|
@ -1077,6 +1077,12 @@ function error() {
|
|||
echo >&2 "[$(date +'%Y-%m-%dT%H:%M:%S')] ERROR: $1"
|
||||
shift
|
||||
for msg in "$@"; do echo >&2 " $msg"; done
|
||||
if [[ -f "$OPENREFINE_TMPDIR/openrefine.log" ]]; then
|
||||
echo >&2 "last 50 lines of OpenRefine's server log:"
|
||||
echo >&2 "-----------------------------------------"
|
||||
tail >&2 -50 "$OPENREFINE_TMPDIR/openrefine.log"
|
||||
echo >&2 "-----------------------------------------"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
function log() {
|
||||
|
@ -1572,7 +1578,7 @@ orcli_test_command() {
|
|||
break
|
||||
fi
|
||||
if [[ $i == 20 ]]; then
|
||||
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
|
||||
error "starting OpenRefine server failed!""
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -1864,7 +1870,7 @@ orcli_run_command() {
|
|||
break
|
||||
fi
|
||||
if [[ $i == 20 ]]; then
|
||||
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
|
||||
error "starting OpenRefine server failed!"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -4,6 +4,12 @@ function error() {
|
|||
echo >&2 "[$(date +'%Y-%m-%dT%H:%M:%S')] ERROR: $1"
|
||||
shift
|
||||
for msg in "$@"; do echo >&2 " $msg"; done
|
||||
if [[ -f "$OPENREFINE_TMPDIR/openrefine.log" ]]; then
|
||||
echo >&2 "last 50 lines of OpenRefine's server log:"
|
||||
echo >&2 "-----------------------------------------"
|
||||
tail >&2 -50 "$OPENREFINE_TMPDIR/openrefine.log"
|
||||
echo >&2 "-----------------------------------------"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
function log() {
|
||||
|
|
|
@ -62,7 +62,7 @@ for i in {1..20}; do
|
|||
break
|
||||
fi
|
||||
if [[ $i == 20 ]]; then
|
||||
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
|
||||
error "starting OpenRefine server failed!"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ for i in {1..20}; do
|
|||
break
|
||||
fi
|
||||
if [[ $i == 20 ]]; then
|
||||
error "starting OpenRefine server failed!" "$(cat "$OPENREFINE_TMPDIR/openrefine.log")"
|
||||
error "starting OpenRefine server failed!"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue