- 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
This commit is contained in:
okir 2003-11-20 15:39:18 +00:00
parent 1648a1cdea
commit 28a5eb0204
1 changed files with 10 additions and 5 deletions

View File

@ -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) 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 *); int (*display_fn)(sc_context_t *, const char *);
char buf[1536], *p; char buf[1536], *p, *tag = "";
int left, r; int left, r;
assert(ctx != NULL); assert(ctx != NULL);
switch (type) { switch (type) {
case SC_LOG_TYPE_ERROR: case SC_LOG_TYPE_ERROR:
if (ctx->suppress_errors) if (!ctx->suppress_errors) {
return; display_fn = &sc_ui_display_error;
display_fn = &sc_ui_display_error; tag = "error:";
break; break;
}
/* Fall thru - suppressed errors are logged as
* debug messages */
tag = "error (suppressed):";
type = SC_LOG_TYPE_DEBUG;
case SC_LOG_TYPE_DEBUG: case SC_LOG_TYPE_DEBUG:
if (ctx->debug == 0) if (ctx->debug == 0)