OpenNI 1.5.7
XnLogTypes.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002 *                                                                            *
00003 *  OpenNI 1.x Alpha                                                          *
00004 *  Copyright (C) 2012 PrimeSense Ltd.                                        *
00005 *                                                                            *
00006 *  This file is part of OpenNI.                                              *
00007 *                                                                            *
00008 *  Licensed under the Apache License, Version 2.0 (the "License");           *
00009 *  you may not use this file except in compliance with the License.          *
00010 *  You may obtain a copy of the License at                                   *
00011 *                                                                            *
00012 *      http://www.apache.org/licenses/LICENSE-2.0                            *
00013 *                                                                            *
00014 *  Unless required by applicable law or agreed to in writing, software       *
00015 *  distributed under the License is distributed on an "AS IS" BASIS,         *
00016 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
00017 *  See the License for the specific language governing permissions and       *
00018 *  limitations under the License.                                            *
00019 *                                                                            *
00020 *****************************************************************************/
00021 #ifndef __XN_LOG_TYPES_H__
00022 #define __XN_LOG_TYPES_H__
00023 
00024 //---------------------------------------------------------------------------
00025 // Includes
00026 //---------------------------------------------------------------------------
00027 #include "XnPlatform.h"
00028 #include "XnTypes.h"
00029 
00030 //---------------------------------------------------------------------------
00031 // Defines
00032 //---------------------------------------------------------------------------
00033 #define XN_LOG_DIR_NAME         "Log"
00034 #define XN_MASK_LOG             "Log"
00035 #define XN_LOG_MASK_ALL         "ALL"
00036 #define XN_LOG_MAX_MASK_NAME    16
00037 
00038 //---------------------------------------------------------------------------
00039 // Enums
00040 //---------------------------------------------------------------------------
00041 typedef enum XnLogSeverity
00042 {
00043     XN_LOG_VERBOSE = 0,
00044     XN_LOG_INFO = 1,
00045     XN_LOG_WARNING = 2,
00046     XN_LOG_ERROR = 3,
00047     XN_LOG_SEVERITY_NONE = 10,
00048 } XnLogSeverity;
00049 
00050 //---------------------------------------------------------------------------
00051 // Structs
00052 //---------------------------------------------------------------------------
00053 typedef struct XnLogger
00054 {
00055     volatile XnLogSeverity nMinSeverity;
00056     void* pInternal;
00057 } XnLogger;
00058 
00059 typedef struct XnLogEntry
00060 {
00061     XnUInt64 nTimestamp;
00062     XnLogSeverity nSeverity;
00063     const XnChar* strSeverity;
00064     const XnChar* strMask;
00065     const XnChar* strMessage;
00066     const XnChar* strFile;
00067     XnUInt32 nLine;
00068 } XnLogEntry;
00069 
00070 typedef struct XnLogWriter
00071 {
00072     void* pCookie;
00073     void (XN_CALLBACK_TYPE* WriteEntry)(const XnLogEntry* pEntry, void* pCookie);
00074     void (XN_CALLBACK_TYPE* WriteUnformatted)(const XnChar* strMessage, void* pCookie);
00075     void (XN_CALLBACK_TYPE* OnConfigurationChanged)(void* pCookie);
00076     void (XN_CALLBACK_TYPE* OnClosing)(void* pCookie);
00077 } XnLogWriter;
00078 
00079 #endif // __XN_LOG_TYPES_H__