void xnLogCreateEntry(XnBufferedLogEntry* pEntry, const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...) { va_list args; va_start(args, csFormat); xnLogCreateEntryV(pEntry, csLogMask, nSeverity, csFile, nLine, csFormat, args); va_end(args); }
void xnLogWriteImplV(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args) { // check if there are any writers registered if (g_logData.m_writers.IsEmpty()) { // don't waste time formatting anything. return; } XnBufferedLogEntry entry; xnLogCreateEntryV(&entry, csLogMask, nSeverity, csFile, nLine, csFormat, args); // write it down xnLogWriteEntry(&entry); }
static void xnLogWriteImplV(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args) { // check if there are any writers registered LogData& logData = LogData::GetInstance(); // optimization: check if any writer is registered *before* locking. if (!logData.anyWriters) { // don't waste time formatting anything. return; } XnBufferedLogEntry entry; xnLogCreateEntryV(&entry, csLogMask, nSeverity, csFile, nLine, csFormat, args); // write it down xnLogWriteEntry(&entry); }