The pcscd daemon (part of pcsc-lite) provides two functions that can be used to log debug messages. You should not use log_msg() directly but use the macros defined in /usr/include/PCSC/debuglog.h.
These logging functions are used by some IFD handlers (smart card driver) like the CCID driver http://pcsclite.alioth.debian.org/ccid.html to benefit from the log framework offered by pcscd (the daemon). With these functions it is easy to change the log level (debug, info, error or critical) and the log output (syslog or stderr) without recompiling the driver.