OpenNI 1.3.2
Defines | Functions
XnLog.h File Reference
#include "XnOS.h"
#include "XnLogTypes.h"
#include "XnDump.h"

Go to the source code of this file.

Defines

#define XN_MASK_RETVAL_CHECKS   "RetValChecks"
#define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal)

Functions

XN_C_API XnStatus XN_C_DECL xnLogInitSystem ()
XN_C_API XnStatus XN_C_DECL xnLogInitFromINIFile (const XnChar *csINIFile, const XnChar *csSectionName)
XN_C_API XnStatus XN_C_DECL xnLogInitFromXmlFile (const XnChar *strFileName)
XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter (const XnLogWriter *pWriter)
XN_C_API void XN_C_DECL xnLogUnregisterLogWriter (const XnLogWriter *pWriter)
XN_C_API XnStatus XN_C_DECL xnLogStartNewFile ()
XN_C_API XnStatus XN_C_DECL xnLogClose ()
XN_C_API XnStatus XN_C_DECL xnLogSetMaskState (const XnChar *csMask, XnBool bEnabled)
XN_C_API XnStatus XN_C_DECL xnLogSetSeverityFilter (XnLogSeverity nMinSeverity)
XN_C_API XnStatus XN_C_DECL xnLogSetConsoleOutput (XnBool bConsoleOutput)
XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput (XnBool bFileOutput)
XN_C_API XnStatus XN_C_DECL xnLogSetLineInfo (XnBool bLineInfo)
XN_C_API XnStatus XN_C_DECL xnLogSetOutputFolder (const XnChar *strOutputFolder)
XN_C_API XnBool XN_C_DECL xnLogIsEnabled (const XnChar *csLogMask, XnLogSeverity nSeverity)
XN_C_API void XN_C_DECL xnLogWrite (const XnChar *csLogMask, XnLogSeverity nSeverity, const XnChar *csFile, XnUInt32 nLine, const XnChar *csFormat,...)
XN_C_API void XN_C_DECL xnLogWriteNoEntry (const XnChar *csLogMask, XnLogSeverity nSeverity, const XnChar *csFormat,...)
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,...)
XN_C_API XnStatus XN_C_DECL xnLogCreateFile (const XnChar *csFileName, XN_FILE_HANDLE *phFile)

Define Documentation

#define XN_IS_STATUS_OK_LOG_ERROR (   what,
  nRetVal 
)
Value:
if (nRetVal != XN_STATUS_OK)                                                                    \
    {                                                                                               \
        xnLogError(XN_MASK_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal));    \
        XN_ASSERT(FALSE);                                                                           \
        return (nRetVal);                                                                           \
    }

Validates return value and writes log message with appropriate status string

#define XN_MASK_RETVAL_CHECKS   "RetValChecks"

Function Documentation

XN_C_API XnStatus XN_C_DECL xnLogClose ( )

This function closes the log.

XN_C_API XnStatus XN_C_DECL xnLogCreateFile ( const XnChar *  csFileName,
XN_FILE_HANDLE *  phFile 
)

Creates a file under the logs directory.

Parameters:
csFileName[in] Name of the file to create
phFile[out] The file handle.
XN_C_API XnStatus XN_C_DECL xnLogInitFromINIFile ( const XnChar *  csINIFile,
const XnChar *  csSectionName 
)

This function initializes the log from an INI file.

Parameters:
csINIFile[in] The name of the INI file.
csSectionName[in] The name of the section to read values from.
XN_C_API XnStatus XN_C_DECL xnLogInitFromXmlFile ( const XnChar *  strFileName)

This function initializes the log from an XML file.

Parameters:
strFileName[in] The name of the XML file.
XN_C_API XnStatus XN_C_DECL xnLogInitSystem ( )

This function initializes the log system.

XN_C_API XnBool XN_C_DECL xnLogIsEnabled ( const XnChar *  csLogMask,
XnLogSeverity  nSeverity 
)

This function checks if a mask is enabled.

Parameters:
csLogMask[in] The mask that should be checked.
nSeverity[in] The severity.
XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter ( const XnLogWriter pWriter)

Registers a new Log Writer to receive log entries.

Parameters:
pWriter[in] The writer to register
XN_C_API XnStatus XN_C_DECL xnLogSetConsoleOutput ( XnBool  bConsoleOutput)

Configures if log entries will be printed to console.

Parameters:
bConsoleOutput[in] TRUE to print log entries to console, FALSE otherwise.
XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput ( XnBool  bFileOutput)

Configures if log entries will be printed to a log file.

Parameters:
bFileOutput[in] TRUE to print log entries to the file, FALSE otherwise.
XN_C_API XnStatus XN_C_DECL xnLogSetLineInfo ( XnBool  bLineInfo)

Configures if log entries will include the file and line that caused them.

Parameters:
bLineInfo[in] TRUE to print file and line, FALSE otherwise
XN_C_API XnStatus XN_C_DECL xnLogSetMaskState ( const XnChar *  csMask,
XnBool  bEnabled 
)

Configures if a specific log mask is enabled.

Parameters:
csMask[in] The mask to set.
bEnabled[in] TRUE to enable this mask, FALSE otherwise.
XN_C_API XnStatus XN_C_DECL xnLogSetOutputFolder ( const XnChar *  strOutputFolder)

Configures the folder under which logs will be written.

Parameters:
strOutputFolder[in] Folder to write to
XN_C_API XnStatus XN_C_DECL xnLogSetSeverityFilter ( XnLogSeverity  nMinSeverity)

Configures the minimum severity the log will output.

Parameters:
nMinSeverity[in] The minimum severity to output.
XN_C_API XnStatus XN_C_DECL xnLogStartNewFile ( )

This function closes current log file, and starts a new one

XN_C_API void XN_C_DECL xnLogUnregisterLogWriter ( const XnLogWriter pWriter)

Unregisters a Log Writer from receiving log entries.

Parameters:
pWriter[in] The writer to unregister
XN_C_API void XN_C_DECL xnLogWrite ( const XnChar *  csLogMask,
XnLogSeverity  nSeverity,
const XnChar *  csFile,
XnUInt32  nLine,
const XnChar *  csFormat,
  ... 
)

This function writes a formatted string to the log (only if the mask is turned on)

Parameters:
csLogMask[in] The mask under which this log should be written.
nSeverity[in] The severity of this log.
csFile[in] The name of the file writing this log entry.
nLine[in] The line number writing this log entry.
csFormat[in] A format string.
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,
  ... 
)

This function writes binary data as hex bytes (only if the mask is turned on).

Parameters:
csLogMask[in] The mask under which this log should be written.
nSeverity[in] The severity of this log.
csFile[in] The name of the file writing this log entry.
nLine[in] The line number writing this log entry.
pBinData[in] The binary data to be written.
nDataSize[in] The number of bytes in the binary data.
csFormat[in] A format string to precede the binary data.
XN_C_API void XN_C_DECL xnLogWriteNoEntry ( const XnChar *  csLogMask,
XnLogSeverity  nSeverity,
const XnChar *  csFormat,
  ... 
)

This function writes a formatted string to the log (only if the mask is turned on), but without marking the timestamp, and without placing the end-of-line marker. It is used for writing complex data to the log file.

Parameters:
csLogMask[in] The mask under which this log should be written.
nSeverity[in] The severity of this log.
csFormat[in] A format string.