Subsections

log_msg

Synopsis:

#include <debuglog.h>

void debug_msg(const int priority,
    const char *fmt,
    ...);

Parameters:

priority IN priority level
fmt IN format string as in printf()
... IN optionnal parameters as in printf()

The priority parameter may be:

PCSC_LOG_DEBUG for debug information
PCSC_LOG_INFO default pcscd level
PCSC_LOG_ERROR for errors
PCSC_LOG_CRITICAL for critical messages (like the driver fails to start)

Description:

This function is used by the driver to send debug or log information to the administrator. The advantage of using the same debug function as pcsc-lite is that you also benefit from the debug redirection provided by pcsc-lite. You will then get pcscd and the driver' debug messages in the same place.

The log messages are displayed by pcscd either on stderr (if pcscd is called with -foreground) or using syslog(3) (default).

The level is set using pcscd arguments -debug, -info, -error or -critical.

The levels are ordered. if -info is given all the messages of priority PCSC_LOG_INFO, PCSC_LOG_ERROR and PCSC_LOG_CRITICAL are displayed.

You should not use log_msg directly but use the Logx() macros defined in <debuglog.h> instead. Using the macro you will also get the file name, line number and function name the macro is called from.

Example:

#include <debuglog.h>

Log2("received bytes: %d", r);

Ludovic Rousseau 2008-01-18