From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: man/, src/libeinfo/
Date: Tue, 3 Sep 2013 18:11:04 +0000 (UTC) [thread overview]
Message-ID: <1378231435.2590bf7a2bc40e2fcd5cbe1f4f063d820c2c5438.WilliamH@OpenRC> (raw)
commit: 2590bf7a2bc40e2fcd5cbe1f4f063d820c2c5438
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sun Sep 1 20:06:15 2013 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Sep 3 18:03:55 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2590bf7a
libeinfo: add separate variable to suppress eerror messages
Add an EERROR_QUIET environment variable which works like EINFO_QUIET
but for the eerror functions. This will allow library consumers to
choose whether to suppress eerror messages separately from einfo and
ewarn messages.
X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
---
man/einfo.3 | 7 ++++++-
src/libeinfo/libeinfo.c | 12 +++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/man/einfo.3 b/man/einfo.3
index 31c4b68..f7b1fd2 100644
--- a/man/einfo.3
+++ b/man/einfo.3
@@ -107,7 +107,6 @@ respectively, but only work when
is true. You can also make the
.Fn einfo ,
.Fn ewarn ,
-.Fn eerror ,
and
.Fn ebegin
functions silent by setting
@@ -186,6 +185,12 @@ when set to true makes the
and
.Fn einfon
family of functions quiet, so nothing is printed.
+.Va EERROR_QUIET
+when set to true makes the
+.Fn eerror
+and
+.Fn eerrorn
+family of functions quiet, so nothing is printed.
.Pp
.Va EINFO_VERBOSE
when set to true makes the
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index 7b1f2da..9791051 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -274,6 +274,12 @@ is_quiet(void)
}
static bool
+is_really_quiet(void)
+{
+ return yesno(getenv("EERROR_QUIET"));
+}
+
+static bool
is_verbose(void)
{
return yesno(getenv ("EINFO_VERBOSE"));
@@ -674,7 +680,7 @@ eerrorn(const char *EINFO_RESTRICT fmt, ...)
int retval;
va_list ap;
- if (!fmt || is_quiet())
+ if (!fmt || is_really_quiet())
return 0;
va_start(ap, fmt);
retval = _eerrorvn(fmt, ap);
@@ -742,7 +748,7 @@ eerror(const char *EINFO_RESTRICT fmt, ...)
int retval;
va_list ap;
- if (!fmt || is_quiet())
+ if (!fmt || is_really_quiet())
return 0;
va_start(ap, fmt);
elogv(LOG_ERR, fmt, ap);
@@ -759,7 +765,7 @@ eerrorx(const char *EINFO_RESTRICT fmt, ...)
{
va_list ap;
- if (fmt && !is_quiet()) {
+ if (fmt && !is_really_quiet()) {
va_start(ap, fmt);
elogv(LOG_ERR, fmt, ap);
_eerrorvn(fmt, ap);
next reply other threads:[~2013-09-03 18:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 18:11 William Hubbs [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-08-28 19:37 [gentoo-commits] proj/openrc:master commit in: man/, src/libeinfo/ William Hubbs
2013-08-27 15:43 William Hubbs
2011-08-22 17:56 William Hubbs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378231435.2590bf7a2bc40e2fcd5cbe1f4f063d820c2c5438.WilliamH@OpenRC \
--to=williamh@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox