| 205 | } |
| 206 | |
| 207 | static void xnLogWriteImplV(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args) |
| 208 | { |
| 209 | // check if there are any writers registered |
| 210 | LogData& logData = LogData::GetInstance(); |
| 211 | |
| 212 | // optimization: check if any writer is registered *before* locking. |
| 213 | if (!logData.anyWriters) |
| 214 | { |
| 215 | // don't waste time formatting anything. |
| 216 | return; |
| 217 | } |
| 218 | |
| 219 | XnBufferedLogEntry entry; |
| 220 | xnLogCreateEntryV(&entry, csLogMask, nSeverity, csFile, nLine, csFormat, args); |
| 221 | |
| 222 | // write it down |
| 223 | xnLogWriteEntry(&entry); |
| 224 | } |
| 225 | |
| 226 | static void xnLogWriteImpl(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...) |
| 227 | { |
no test coverage detected