Merge pull request #9576 from id/chore-fix-bin-emqx-logging-on-non-tty
chore: fix logging in bin/emqx on non-tty
This commit is contained in:
commit
9066513bef
8
bin/emqx
8
bin/emqx
|
@ -54,11 +54,19 @@ export ERTS_LIB_DIR="$RUNNER_ROOT_DIR/lib"
|
||||||
DYNLIBS_DIR="$RUNNER_ROOT_DIR/dynlibs"
|
DYNLIBS_DIR="$RUNNER_ROOT_DIR/dynlibs"
|
||||||
|
|
||||||
logerr() {
|
logerr() {
|
||||||
|
if [ "${TERM:-dumb}" = dumb ]; then
|
||||||
|
echo -e "ERROR: $*" 1>&2
|
||||||
|
else
|
||||||
echo -e "$(tput setaf 1)ERROR: $*$(tput sgr0)" 1>&2
|
echo -e "$(tput setaf 1)ERROR: $*$(tput sgr0)" 1>&2
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
logwarn() {
|
logwarn() {
|
||||||
|
if [ "${TERM:-dumb}" = dumb ]; then
|
||||||
|
echo "WARNING: $*"
|
||||||
|
else
|
||||||
echo "$(tput setaf 3)WARNING: $*$(tput sgr0)"
|
echo "$(tput setaf 3)WARNING: $*$(tput sgr0)"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
|
|
Loading…
Reference in New Issue