Skip to content

Commit

Permalink
Fix some logging issues
Browse files Browse the repository at this point in the history
Fix ewarn and eerror so they always log to stderr.
Fix eerrorn so that it respects EINFO_QUIET instead of EERROR_QUIET.

This fixes #4.

X-Gentoo-Bug: 548158.
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=548158.
  • Loading branch information
floppym authored and williamh committed May 12, 2015
1 parent e21f340 commit 5b7c6d2
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions functions.sh
Expand Up @@ -116,12 +116,12 @@ einfo()
ewarnn()
{
if yesno "${EINFO_QUIET}"; then
printf " $*"
else
return 0
else
if ! yesno "${RC_ENDCOL}" && [ "${LAST_E_CMD}" = "ebegin" ]; then
printf "\n"
printf "\n" >&2
fi
printf " ${WARN}*${NORMAL} ${RC_INDENTATION}$*"
printf " ${WARN}*${NORMAL} ${RC_INDENTATION}$*" >&2
fi

local name="${0##*/}"
Expand All @@ -138,12 +138,12 @@ ewarnn()
ewarn()
{
if yesno "${EINFO_QUIET}"; then
printf " $*\n"
else
return 0
else
if ! yesno "${RC_ENDCOL}" && [ "${LAST_E_CMD}" = "ebegin" ]; then
printf "\n"
printf "\n" >&2
fi
printf " ${WARN}*${NORMAL} ${RC_INDENTATION}$*\n"
printf " ${WARN}*${NORMAL} ${RC_INDENTATION}$*\n" >&2
fi

local name="${0##*/}"
Expand All @@ -159,13 +159,13 @@ ewarn()
#
eerrorn()
{
if yesno "${EINFO_QUIET}"; then
printf " $*" >/dev/stderr
if yesno "${EERROR_QUIET}"; then
return 0
else
if ! yesno "${RC_ENDCOL}" && [ "${LAST_E_CMD}" = "ebegin" ]; then
printf "\n"
printf "\n" >&2
fi
printf " ${BAD}*${NORMAL} ${RC_INDENTATION}$*"
printf " ${BAD}*${NORMAL} ${RC_INDENTATION}$*" >&2
fi

local name="${0##*/}"
Expand All @@ -181,13 +181,13 @@ eerrorn()
#
eerror()
{
if yesno "${EINFO_QUIET}"; then
printf " $*\n" >/dev/stderr
if yesno "${EERROR_QUIET}"; then
return 0
else
if ! yesno "${RC_ENDCOL}" && [ "${LAST_E_CMD}" = "ebegin" ]; then
printf "\n"
printf "\n" >&2
fi
printf " ${BAD}*${NORMAL} ${RC_INDENTATION}$*\n"
printf " ${BAD}*${NORMAL} ${RC_INDENTATION}$*\n" >&2
fi

local name="${0##*/}"
Expand Down

0 comments on commit 5b7c6d2

Please sign in to comment.