Silence SCARD_E_TIMEOUT warnings

These occur quite often for status calls, so reduce log verbosity.
This commit is contained in:
Armin Novak 2020-05-04 17:32:55 +02:00
parent 5b98aa7515
commit e80316cf9a

View File

@ -42,8 +42,19 @@
static LONG log_status_error(const char* tag, const char* what, LONG status)
{
if (status != SCARD_S_SUCCESS)
WLog_ERR(tag, "%s failed with error %s [%" PRId32 "]", what, SCardGetErrorString(status),
status);
{
DWORD level = WLOG_ERROR;
switch (status)
{
case SCARD_E_TIMEOUT:
level = WLOG_DEBUG;
break;
default:
break;
}
WLog_Print(WLog_Get(tag), level, "%s failed with error %s [%" PRId32 "]", what,
SCardGetErrorString(status), status);
}
return status;
}