140 XN_C_API void XN_C_DECL
xnLogWrite(
const XnChar* csLogMask,
XnLogSeverity nSeverity,
const XnChar* csFile, XnUInt32 nLine,
const XnChar* csFormat, ...);
164 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, ...);
174 #define XN_MASK_RETVAL_CHECKS "RetValChecks"
177 #define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal) \
178 if (nRetVal != XN_STATUS_OK) \
180 xnLogError(XN_MASK_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal)); \
185 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
186 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, __VA_ARGS__)
187 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, __VA_ARGS__)
188 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, __VA_ARGS__)
189 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, __VA_ARGS__)
192 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \
194 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__);\
199 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \
200 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, __VA_ARGS__)
203 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \
204 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, __VA_ARGS__)
206 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
207 #define xnLogVerbose(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
208 #define xnLogInfo(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
209 #define xnLogWarning(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
210 #define xnLogError(csLogMask, csFormat, ...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
213 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...) \
215 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__); \
220 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...) \
221 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, ##__VA_ARGS__)
224 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...) \
225 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, ##__VA_ARGS__)
227 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
228 #define xnLogVerbose(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat)
229 #define xnLogInfo(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat)
230 #define xnLogWarning(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat)
231 #define xnLogError(csLogMask, csFormat...) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat)
234 #define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat...) \
236 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat); \
241 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat...) \
242 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat)
245 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat...) \
246 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat)
249 #define XN_IS_STATUS_OK_LOG(nRetVal, nSeverity, csLogMask, csFormat...) \
250 if (nRetVal != XN_STATUS_OK) \
252 XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat) \
256 #define XN_IS_STATUS_OK_WARNING(nRetVal, csLogMask, csFormat...) \
257 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_WARNING, csLogMask, csFormat)
260 #define XN_IS_STATUS_OK_ERROR(nRetVal, csLogMask, csFormat...) \
261 XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_ERROR, csLogMask, csFormat)
263 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
264 #define xnLogVerbose(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, args)
265 #define xnLogInfo(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat, args)
266 #define xnLogWarning(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat, args)
267 #define xnLogError(csLogMask, csFormat, args) xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, args)
270 #define XN_LOG_RETURN(nRetVal, nSeverity csLogMask, csFormat, args) \
272 xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, args); \
277 #define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, args) \
278 XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, args)
281 #define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, args) \
282 XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, args)
285 #error Xiron Log - Unknown VAARGS type!