cn.tee3.avd_SDK-C++
2.1.0
src
api
debug.h
浏览该文件的文档.
1
#ifndef RTDEBUG_H
2
#define RTDEBUG_H
3
4
#define RT_LOG_MODULE_TRACE
5
//#define RT_DISABLE_TRACE
6
7
#ifndef RT_DISABLE_TRACE
8
#include "avdbase/RtLogger.h"
9
//
10
// Parameters Descriptions:
11
// [module] module number, uint32 type;
12
// [desc ] module description that will be displayed in log output to tell which module
13
// it belong to, const char* type, must be less than 64 bytes in length;
14
// [str ] log content, const char* type;
15
//
16
//#define RT_LOG_REGISTER_MODULE(module, desc) //RtLog::RegisterModule(module, desc)
17
18
#define RT_ERROR_LOG(module, str) RT_LOG(rtcbase::LS_ERROR, module, str)
19
#define RT_WARNING_LOG(module, str) RT_LOG(rtcbase::LS_WARNING, module, str)
20
#define RT_INFO_LOG(module, str) RT_LOG(rtcbase::LS_INFO, module, str)
21
#ifdef _DEBUG
22
#define RT_STATE_LOG(module, str) RT_LOG(rtcbase::LS_VERBOSE, module, str)
23
#else
24
#define RT_STATE_LOG(module, str) RT_LOG(rtcbase::LS_VERBOSE, module, str)
25
#endif
26
27
28
#define RT_ERROR_LOG_THIS(module, str) RT_LOG(rtcbase::LS_ERROR, module, str << " this=" << this)
29
#define RT_WARNING_LOG_THIS(module, str) RT_LOG(rtcbase::LS_WARNING, module, str << " this=" << this)
30
#define RT_INFO_LOG_THIS(module, str) RT_LOG(rtcbase::LS_INFO, module, str << " this=" << this)
31
#define RT_STATE_LOG_THIS(module, str) RT_LOG(rtcbase::LS_VERBOSE, module, str << " this=" << this)
32
33
/*-----------------------------------------------------------------------------------*/
34
35
#define LOG_ERROR(str) RT_ERROR_LOG(RT_LOG_MODULE_TRACE, str)
36
#define LOG_WARNING(str) RT_WARNING_LOG(RT_LOG_MODULE_TRACE, str)
37
#define LOG_INFO(str) RT_INFO_LOG(RT_LOG_MODULE_TRACE, str)
38
#define LOG_STATE(str) RT_STATE_LOG(RT_LOG_MODULE_TRACE, str)
39
40
#define LOG_ERROR_T(str) LOG_ERROR(str << " this=" << this)
41
#define LOG_WARNING_T(str) LOG_WARNING(str << " this=" << this)
42
#define LOG_INFO_T(str) LOG_INFO(str << " this=" << this)
43
#define LOG_STATE_T(str) LOG_STATE(str << " this=" << this)
44
45
#define LOG_ERROR_F(str) LOG_ERROR(__FUNCTION__ << ": " << str)
46
#define LOG_WARNING_F(str) LOG_WARNING(__FUNCTION__ << ": " << str)
47
#define LOG_INFO_F(str) LOG_INFO(__FUNCTION__ << ": " << str)
48
#define LOG_STATE_F(str) LOG_STATE(__FUNCTION__ << ": " << str)
49
50
#define LOG_ERROR_T_F(str) LOG_ERROR(__FUNCTION__ << ": " << str << " this=" << this)
51
#define LOG_WARNING_T_F(str) LOG_WARNING(__FUNCTION__ << ": " << str << " this=" << this)
52
#define LOG_INFO_T_F(str) LOG_INFO(__FUNCTION__ << ": " << str << " this=" << this)
53
#define LOG_STATE_T_F(str) LOG_STATE(__FUNCTION__ << ": " << str << " this=" << this)
54
#else
55
56
//#define RT_LOG_REGISTER_MODULE(module, desc)
57
58
#define RT_ERROR_LOG(module, str)
59
#define RT_WARNING_LOG(module, str)
60
#define RT_INFO_LOG(module, str)
61
#define RT_STATE_LOG(module, str)
62
63
#define RT_ERROR_LOG_THIS(module, str)
64
#define RT_WARNING_LOG_THIS(module, str)
65
#define RT_INFO_LOG_THIS(module, str)
66
#define RT_STATE_LOG_THIS(module, str)
67
68
/*-----------------------------------------------------------------------------------*/
69
70
#define LOG_ERROR(str)
71
#define LOG_WARNING(str)
72
#define LOG_INFO(str)
73
#define LOG_STATE(str)
74
#define RT_FUNC_TRACE(str)
75
76
#define LOG_ERROR_T(str)
77
#define LOG_WARNING_T(str)
78
#define LOG_INFO_T(str)
79
#define LOG_STATE_T(str)
80
81
#define LOG_ERROR_F(str)
82
#define LOG_WARNING_F(str)
83
#define LOG_INFO_F(str)
84
#define LOG_STATE_F(str)
85
86
#define LOG_ERROR_T_F(str)
87
#define LOG_WARNING_T_F(str)
88
#define LOG_INFO_T_F(str)
89
#define LOG_STATE_T_F(str)
90
#endif // RT_DISABLE_TRACE
91
92
93
#define RT_DIAGNOSE_TRACE(str)
94
95
#endif // RTDEBUG_H
制作者
1.8.13