 |
OpenNI 1.5.4
|
Go to the documentation of this file.
235 #define xnLoggerClose(pLogger) \
237 _xnLoggerClose(pLogger); \
241 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
245 #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \
246 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
248 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \
254 #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, __VA_ARGS__)
258 #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, __VA_ARGS__)
262 #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, __VA_ARGS__)
266 #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, __VA_ARGS__)
276 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \
278 xnLoggerWriteHelper(pLogger, severity, csFormat, __VA_ARGS__); \
289 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \
290 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, __VA_ARGS__)
299 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \
300 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, __VA_ARGS__)
302 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
303 #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \
304 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
306 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \
309 #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat,## __VA_ARGS__)
310 #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, ##__VA_ARGS__)
311 #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, ##__VA_ARGS__)
312 #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, ##__VA_ARGS__)
315 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \
317 xnLoggerWriteHelper(pLogger, severity, csFormat, ##__VA_ARGS__); \
322 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \
323 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, ##__VA_ARGS__)
326 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \
327 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, ##__VA_ARGS__)
329 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
330 #define xnLoggerWriteHelper(pLogger, severity, csFormat...) \
331 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
333 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat); \
336 #define xnLoggerVerbose(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat)
337 #define xnLoggerInfo(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat)
338 #define xnLoggerWarning(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat)
339 #define xnLoggerError(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat)
342 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat...) \
344 xnLoggerWriteHelper(pLogger, severity, csFormat); \
349 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat...) \
350 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat)
353 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat...) \
354 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat)
356 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
357 #define xnLoggerWriteHelper(pLogger, severity, csFormat, arg) \
358 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \
360 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, arg); \
363 #define xnLoggerVerbose(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, arg)
364 #define xnLoggerInfo(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, arg)
365 #define xnLoggerWarning(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, arg)
366 #define xnLoggerError(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, arg)
369 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat) \
371 xnLoggerWriteHelper(pLogger, severity, csFormat); \
376 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat) \
377 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat)
380 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat) \
381 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat)
384 #error Xiron Log - Unknown VAARGS type!
410 #define XN_MASK_RETVAL_CHECKS "RetValChecks"
412 #if XN_PLATFORM == XN_PLATFORM_ARC
419 #define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal) \
420 if (nRetVal != XN_STATUS_OK) \
422 xnLoggerError(XN_LOGGER_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal)); \
430 XN_C_API XnStatus XN_API_DEPRECATED(
"Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
433 XN_C_API void XN_C_DECL xnLogWrite(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
434 XN_C_API void XN_C_DECL xnLogWriteNoEntry(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFormat, ...);
435 XN_C_API void XN_C_DECL xnLogWriteBinaryData(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...);
437 XN_C_API XnStatus XN_API_DEPRECATED("Use
xnLogCreateNewFile() instead") XN_C_DECL xnLogCreateFileEx(const XnChar* strFileName, XnBool bSessionBased, XN_FILE_HANDLE* phFile);
439 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
440 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, __VA_ARGS__)
441 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, __VA_ARGS__)
442 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, __VA_ARGS__)
443 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, __VA_ARGS__)
446 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \
448 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \
453 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \
454 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, __VA_ARGS__)
457 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \
458 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, __VA_ARGS__)
460 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
461 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
462 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
463 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
464 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
467 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \
469 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \
474 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \
475 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, ##__VA_ARGS__)
478 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \
479 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, ##__VA_ARGS__)
481 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
482 #define xnLogVerbose(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat)
483 #define xnLogInfo(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat)
484 #define xnLogWarning(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat)
485 #define xnLogError(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat)
488 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat...) \
490 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat); \
495 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat...) \
496 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat)
499 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat...) \
500 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat)
503 #define XN_IS_STATUS_OK_LOG(nRetVal, nSeverity, csLogMask, csFormat...) \
504 if (nRetVal != XN_STATUS_OK) \
506 XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat) \
510 #define XN_IS_STATUS_OK_WARNING(nRetVal, csLogMask, csFormat...) \
511 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_WARNING, csLogMask, csFormat)
514 #define XN_IS_STATUS_OK_ERROR(nRetVal, csLogMask, csFormat...) \
515 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_ERROR, csLogMask, csFormat)
517 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
518 #define xnLogVerbose(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, args)
519 #define xnLogInfo(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, args)
520 #define xnLogWarning(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, args)
521 #define xnLogError(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, args)
524 #define XN_LOG_RETURN(nRetVal, nSeverity csLogMask, csFormat, args) \
526 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, args); \
531 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, args) \
532 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, args)
535 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, args) \
536 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, args)
539 #error Xiron Log - Unknown VAARGS type!
542 #endif // ifndef __XN_NO_BC__
XnLogSeverity
Definition: XnLogTypes.h:42
XN_C_API XnBool XN_C_DECL xnLoggerIsEnabled(XnLogger *pLogger, XnLogSeverity severity)
XN_C_API XnStatus XN_C_DECL xnLogSetLineInfo(XnBool bLineInfo)
XN_C_API XnStatus XN_C_DECL xnLogClose()
XN_C_API void XN_C_DECL xnLoggerWriteNoEntry(XnLogger *pLogger, XnLogSeverity severity, const XnChar *strFormat,...)
XnUInt32 XnStatus
Definition: XnStatus.h:34
XN_C_API XnStatus XN_C_DECL xnLogSetMaskMinSeverity(const XnChar *strMask, XnLogSeverity minSeverity)
XN_C_API XnLogSeverity XN_C_DECL xnLogGetMaskMinSeverity(const XnChar *strMask)
XN_C_API XnStatus XN_C_DECL xnLogGetFileName(XnChar *strFileName, XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL xnLogSetConsoleOutput(XnBool bConsoleOutput)
XN_C_API XnStatus XN_C_DECL xnLogInitFromXmlFile(const XnChar *strFileName)
XN_C_API XnStatus XN_C_DECL xnLogStartNewFile()
XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput(XnBool bFileOutput)
Definition: XnLogTypes.h:71
XN_C_API XnLogger *XN_C_DECL xnLoggerOpen(const XnChar *strMask)
XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter(XnLogWriter *pWriter)
XN_C_API XnStatus XN_C_DECL xnLogInitFromINIFile(const XnChar *csINIFile, const XnChar *csSectionName)
XN_C_API XnStatus XN_C_DECL xnLogInitSystem()
XN_C_API void XN_C_DECL xnLogUnregisterLogWriter(XnLogWriter *pWriter)
XN_C_API XnLogger * XN_LOGGER_RETVAL_CHECKS
Definition: XnLog.h:415
XN_C_API XnStatus XN_C_DECL xnLogSetOutputFolder(const XnChar *strOutputFolder)
XN_C_API void XN_C_DECL xnLoggerWriteBinaryData(XnLogger *pLogger, XnLogSeverity severity, const XnChar *strFile, XnUInt32 nLine, XnUChar *pBinData, XnUInt32 nDataSize, const XnChar *strFormat,...)
XN_C_API void XN_C_DECL xnLoggerWrite(XnLogger *pLogger, XnLogSeverity severity, const XnChar *strFile, XnUInt32 nLine, const XnChar *strFormat,...)
XN_C_API XnStatus XN_C_DECL xnLogCreateNewFile(const XnChar *strName, XnBool bSessionBased, XnChar *csFullPath, XnUInt32 nPathBufferSize, XN_FILE_HANDLE *phFile)
Definition: XnLogTypes.h:54