128 #if XN_PLATFORM == XN_PLATFORM_ANDROID_ARM 242 #define xnLoggerClose(pLogger) \ 244 _xnLoggerClose(pLogger); \ 248 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE 252 #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \ 253 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 255 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \ 261 #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, __VA_ARGS__) 265 #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, __VA_ARGS__) 269 #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, __VA_ARGS__) 273 #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, __VA_ARGS__) 283 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \ 285 xnLoggerWriteHelper(pLogger, severity, csFormat, __VA_ARGS__); \ 296 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \ 297 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, __VA_ARGS__) 306 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \ 307 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, __VA_ARGS__) 309 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE 310 #define xnLoggerWriteHelper(pLogger, severity, csFormat, ...) \ 311 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 313 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \ 316 #define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat,## __VA_ARGS__) 317 #define xnLoggerInfo(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, ##__VA_ARGS__) 318 #define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, ##__VA_ARGS__) 319 #define xnLoggerError(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, ##__VA_ARGS__) 322 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...) \ 324 xnLoggerWriteHelper(pLogger, severity, csFormat, ##__VA_ARGS__); \ 329 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...) \ 330 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, ##__VA_ARGS__) 333 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...) \ 334 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, ##__VA_ARGS__) 336 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE 337 #define xnLoggerWriteHelper(pLogger, severity, csFormat...) \ 338 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 340 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat); \ 343 #define xnLoggerVerbose(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat) 344 #define xnLoggerInfo(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat) 345 #define xnLoggerWarning(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat) 346 #define xnLoggerError(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat) 349 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat...) \ 351 xnLoggerWriteHelper(pLogger, severity, csFormat); \ 356 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat...) \ 357 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat) 360 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat...) \ 361 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat) 363 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS 364 #define xnLoggerWriteHelper(pLogger, severity, csFormat, arg) \ 365 if (pLogger != NULL && severity >= pLogger->nMinSeverity) \ 367 xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, arg); \ 370 #define xnLoggerVerbose(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, arg) 371 #define xnLoggerInfo(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, arg) 372 #define xnLoggerWarning(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, arg) 373 #define xnLoggerError(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, arg) 376 #define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat) \ 378 xnLoggerWriteHelper(pLogger, severity, csFormat); \ 383 #define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat) \ 384 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat) 387 #define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat) \ 388 XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat) 391 #error Xiron Log - Unknown VAARGS type! 417 #define XN_MASK_RETVAL_CHECKS "RetValChecks" 419 #if XN_PLATFORM == XN_PLATFORM_ARC 426 #define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal) \ 427 if (nRetVal != XN_STATUS_OK) \ 429 xnLoggerError(XN_LOGGER_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal)); \ 437 XN_C_API XnStatus XN_API_DEPRECATED(
"Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
440 XN_C_API void XN_C_DECL xnLogWrite(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
441 XN_C_API void XN_C_DECL xnLogWriteNoEntry(const XnChar* csLogMask,
XnLogSeverity nSeverity, const XnChar* csFormat, ...);
442 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, ...);
444 XN_C_API XnStatus XN_API_DEPRECATED("Use
xnLogCreateNewFile() instead") XN_C_DECL xnLogCreateFileEx(const XnChar* strFileName, XnBool bSessionBased, XN_FILE_HANDLE* phFile);
446 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE 447 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, __VA_ARGS__) 448 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, __VA_ARGS__) 449 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, __VA_ARGS__) 450 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, __VA_ARGS__) 453 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \ 455 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__); \ 460 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \ 461 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, __VA_ARGS__) 464 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \ 465 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, __VA_ARGS__) 467 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE 468 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 469 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 470 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 471 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, ##__VA_ARGS__) 474 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \ 476 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \ 481 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \ 482 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, ##__VA_ARGS__) 485 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \ 486 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, ##__VA_ARGS__) 488 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE 489 #define xnLogVerbose(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat) 490 #define xnLogInfo(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat) 491 #define xnLogWarning(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat) 492 #define xnLogError(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat) 495 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat...) \ 497 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat); \ 502 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat...) \ 503 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat) 506 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat...) \ 507 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat) 510 #define XN_IS_STATUS_OK_LOG(nRetVal, nSeverity, csLogMask, csFormat...) \ 511 if (nRetVal != XN_STATUS_OK) \ 513 XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat) \ 517 #define XN_IS_STATUS_OK_WARNING(nRetVal, csLogMask, csFormat...) \ 518 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_WARNING, csLogMask, csFormat) 521 #define XN_IS_STATUS_OK_ERROR(nRetVal, csLogMask, csFormat...) \ 522 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_ERROR, csLogMask, csFormat) 524 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS 525 #define xnLogVerbose(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, args) 526 #define xnLogInfo(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, args) 527 #define xnLogWarning(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, args) 528 #define xnLogError(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, args) 531 #define XN_LOG_RETURN(nRetVal, nSeverity csLogMask, csFormat, args) \ 533 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, args); \ 538 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, args) \ 539 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, args) 542 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, args) \ 543 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, args) 546 #error Xiron Log - Unknown VAARGS type! 549 #endif // ifndef __XN_NO_BC__ 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:41
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 xnLogGetFileName(XnChar *strFileName, XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL xnLogStartNewFile()
XnUInt32 XnStatus
Definition: XnStatus.h:33
Definition: XnLogTypes.h:70
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 xnLogRegisterLogWriter(XnLogWriter *pWriter)
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 void XN_C_DECL xnLogUnregisterLogWriter(XnLogWriter *pWriter)
XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput(XnBool bFileOutput)
XN_C_API XnStatus XN_C_DECL xnLogInitSystem()
XN_C_API XnLogger * XN_LOGGER_RETVAL_CHECKS
Definition: XnLog.h:422
Definition: XnLogTypes.h:53
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)
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)