diff options
-rw-r--r-- | man/einfo.3 | 7 | ||||
-rw-r--r-- | src/libeinfo/libeinfo.c | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/man/einfo.3 b/man/einfo.3 index 31c4b68c..f7b1fd26 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 7b1f2da5..9791051f 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); |