Force stdout to stderr in ynh_debug

Merge as a micro decision.
This commit is contained in:
Maniack Crudelis 2019-04-01 21:24:15 +02:00 committed by GitHub
parent 8571ad874f
commit 26e77b77ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,8 @@ ynh_debug () {
PS4='$(basename ${BASH_SOURCE[0]})-L${LINENO}: ' PS4='$(basename ${BASH_SOURCE[0]})-L${LINENO}: '
# Force xtrace to stderr # Force xtrace to stderr
BASH_XTRACEFD=2 BASH_XTRACEFD=2
# Force stdout to stderr
exec 1>&2
fi fi
if [ "$trace" == "0" ] if [ "$trace" == "0" ]
then then
@ -44,6 +46,8 @@ ynh_debug () {
set +x set +x
# Put xtrace back to its original fild descriptor # Put xtrace back to its original fild descriptor
BASH_XTRACEFD=$old_bash_xtracefd BASH_XTRACEFD=$old_bash_xtracefd
# Restore stdout
exec 1>&1
fi fi
# Renable set xtrace # Renable set xtrace
set -x set -x