227 #define xnLoggerClose(pLogger) \ 229 _xnLoggerClose(pLogger); \ 233 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE 237 #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \ 238 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 240 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \ 246 #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, __VA_ARGS__) 250 #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, __VA_ARGS__) 254 #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, __VA_ARGS__) 258 #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, __VA_ARGS__) 268 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \ 270 xnLoggerWriteHelper(pLogger, severity, csFormat, __VA_ARGS__); \ 281 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \ 282 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, __VA_ARGS__) 291 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \ 292 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, __VA_ARGS__) 294 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE 295 #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \ 296 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 298 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \ 301 #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat,## __VA_ARGS__) 302 #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, ##__VA_ARGS__) 303 #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, ##__VA_ARGS__) 304 #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, ##__VA_ARGS__) 307 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \ 309 xnLoggerWriteHelper(pLogger, severity, csFormat, ##__VA_ARGS__); \ 314 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \ 315 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, ##__VA_ARGS__) 318 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \ 319 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, ##__VA_ARGS__) 321 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE 322 #define xnLoggerWriteHelper(pLogger, severity, csFormat...) \ 323 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 325 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat); \ 328 #define xnLoggerVerbose(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat) 329 #define xnLoggerInfo(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat) 330 #define xnLoggerWarning(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat) 331 #define xnLoggerError(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat) 334 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat...) \ 336 xnLoggerWriteHelper(pLogger, severity, csFormat); \ 341 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat...) \ 342 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat) 345 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat...) \ 346 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat) 348 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS 349 #define xnLoggerWriteHelper(pLogger, severity, csFormat, arg) \ 350 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 352 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, arg); \ 355 #define xnLoggerVerbose(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, arg) 356 #define xnLoggerInfo(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, arg) 357 #define xnLoggerWarning(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, arg) 358 #define xnLoggerError(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, arg) 361 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat) \ 363 xnLoggerWriteHelper(pLogger, severity, csFormat); \ 368 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat) \ 369 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat) 372 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat) \ 373 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat) 376 #error Xiron Log - Unknown VAARGS type! 408 #define XN_MASK_RETVAL_CHECKS "RetValChecks" 410 #if XN_PLATFORM == XN_PLATFORM_ARC 417 #define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal) \ 418 if (nRetVal != XN_STATUS_OK) \ 420 xnLoggerError(XN_LOGGER_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal)); \ 428 XN_C_API XnStatus XN_API_DEPRECATED(
"Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
431 XN_C_API void XN_C_DECL xnLogWrite(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
432 XN_C_API void XN_C_DECL xnLogWriteNoEntry(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFormat, ...);
433 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, ...);
435 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE 436 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, __VA_ARGS__) 437 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, __VA_ARGS__) 438 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, __VA_ARGS__) 439 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, __VA_ARGS__) 442 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \ 444 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \ 449 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \ 450 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, __VA_ARGS__) 453 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \ 454 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, __VA_ARGS__) 456 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE 457 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 458 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 459 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 460 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 463 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \ 465 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \ 470 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \ 471 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, ##__VA_ARGS__) 474 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \ 475 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, ##__VA_ARGS__) 477 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE 478 #define xnLogVerbose(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat) 479 #define xnLogInfo(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat) 480 #define xnLogWarning(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat) 481 #define xnLogError(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat) 484 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat...) \ 486 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat); \ 491 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat...) \ 492 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat) 495 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat...) \ 496 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat) 499 #define XN_IS_STATUS_OK_LOG(nRetVal, nSeverity, csLogMask, csFormat...) \ 500 if (nRetVal != XN_STATUS_OK) \ 502 XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat) \ 506 #define XN_IS_STATUS_OK_WARNING(nRetVal, csLogMask, csFormat...) \ 507 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_WARNING, csLogMask, csFormat) 510 #define XN_IS_STATUS_OK_ERROR(nRetVal, csLogMask, csFormat...) \ 511 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_ERROR, csLogMask, csFormat) 513 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS 514 #define xnLogVerbose(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, args) 515 #define xnLogInfo(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, args) 516 #define xnLogWarning(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, args) 517 #define xnLogError(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, args) 520 #define XN_LOG_RETURN(nRetVal, nSeverity csLogMask, csFormat, args) \ 522 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, args); \ 527 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, args) \ 528 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, args) 531 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, args) \ 532 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, args) 535 #error Xiron Log - Unknown VAARGS type! 538 #endif // ifndef __XN_NO_BC__ XN_C_API XnStatus XN_C_DECL xnLogCreateFileEx(const XnChar *strFileName, XnBool bSessionBased, XN_FILE_HANDLE *phFile)
XN_C_API void XN_C_DECL xnLoggerWriteBinaryData(XnLogger *pLogger, XnLogSeverity severity, const XnChar *strFile, XnUInt32 nLine, XnUChar *pBinData, XnUInt32 nDataSize, const XnChar *strFormat,...)
XnLogSeverity
Definition: XnLogTypes.h:42
XN_C_API void XN_C_DECL xnLoggerWriteNoEntry(XnLogger *pLogger, XnLogSeverity severity, const XnChar *strFormat,...)
XN_C_API XnStatus XN_C_DECL xnLogSetLineInfo(XnBool bLineInfo)
XN_C_API XnStatus XN_C_DECL xnLogStartNewFile()
XnUInt32 XnStatus
Definition: XnStatus.h:34
XN_C_API void XN_C_DECL xnLogUnregisterLogWriter(const XnLogWriter *pWriter)
Definition: XnLogTypes.h:71
XN_C_API XnLogger *XN_C_DECL xnLoggerOpen(const XnChar *strMask)
XN_C_API XnStatus XN_C_DECL xnLogInitFromINIFile(const XnChar *csINIFile, const XnChar *csSectionName)
XN_C_API XnStatus XN_C_DECL xnLogSetMaskMinSeverity(const XnChar *strMask, XnLogSeverity minSeverity)
XN_C_API XnStatus XN_C_DECL xnLogSetConsoleOutput(XnBool bConsoleOutput)
XN_C_API XnStatus XN_C_DECL xnLogInitFromXmlFile(const XnChar *strFileName)
XN_C_API XnLogSeverity XN_C_DECL xnLogGetMaskMinSeverity(const XnChar *strMask)
XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput(XnBool bFileOutput)
XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar *strFileName, XN_FILE_HANDLE *phFile)
XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter(const XnLogWriter *pWriter)
XN_C_API XnStatus XN_C_DECL xnLogInitSystem()
XN_C_API XnLogger * XN_LOGGER_RETVAL_CHECKS
Definition: XnLog.h:413
Definition: XnLogTypes.h:54
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 xnLogSetOutputFolder(const XnChar *strOutputFolder)
XN_C_API XnStatus XN_C_DECL xnLogClose()
XN_C_API XnBool XN_C_DECL xnLoggerIsEnabled(XnLogger *pLogger, XnLogSeverity severity)