From 28a5eb0204187dc73bcf34c482e5e7f0a45a547e Mon Sep 17 00:00:00 2001 From: okir Date: Thu, 20 Nov 2003 15:39:18 +0000 Subject: [PATCH] - if ctx->suppress_errors is non-zero, log suppressed error messages at least to the debug log git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1621 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/libopensc/log.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libopensc/log.c b/src/libopensc/log.c index 4e421ef2..a3a97ac3 100644 --- a/src/libopensc/log.c +++ b/src/libopensc/log.c @@ -68,17 +68,22 @@ void sc_do_log(struct sc_context *ctx, int type, const char *file, int line, con void sc_do_log_va(struct sc_context *ctx, int type, const char *file, int line, const char *func, const char *format, va_list args) { int (*display_fn)(sc_context_t *, const char *); - char buf[1536], *p; + char buf[1536], *p, *tag = ""; int left, r; assert(ctx != NULL); switch (type) { case SC_LOG_TYPE_ERROR: - if (ctx->suppress_errors) - return; - display_fn = &sc_ui_display_error; - break; + if (!ctx->suppress_errors) { + display_fn = &sc_ui_display_error; + tag = "error:"; + break; + } + /* Fall thru - suppressed errors are logged as + * debug messages */ + tag = "error (suppressed):"; + type = SC_LOG_TYPE_DEBUG; case SC_LOG_TYPE_DEBUG: if (ctx->debug == 0)