MythTV master
verbosedefs.h
Go to the documentation of this file.
1#ifndef VERBOSEDEFS_H_
2#define VERBOSEDEFS_H_
3
4#ifdef __cplusplus
5#include <QMap>
6#include <QString>
7#include <QMutex>
8#include <cstdint>
9#else
10#include <stdint.h>
11#endif
12
31
32#undef VERBOSE_PREAMBLE
33#undef VERBOSE_POSTAMBLE
34#undef VERBOSE_MAP
35
36#undef LOGLEVEL_PREAMBLE
37#undef LOGLEVEL_POSTAMBLE
38#undef LOGLEVEL_MAP
39
40// NOLINTBEGIN(cppcoreguidelines-macro-usage)
41
42#ifdef MYTH_IMPLEMENT_VERBOSE
43
44// This is used to actually implement the mask in mythlogging.cpp
45#define VERBOSE_PREAMBLE
46#define VERBOSE_POSTAMBLE
47#define VERBOSE_MAP(name,mask,additive,help) \
48 verboseAdd(mask,QString(#name),additive,QString(help));
49
50#define LOGLEVEL_PREAMBLE
51#define LOGLEVEL_POSTAMBLE
52#define LOGLEVEL_MAP(name,value,shortname) \
53 loglevelAdd(value,QString(#name),shortname);
54
55#else // !defined(MYTH_IMPLEMENT_VERBOSE)
56
57// This is used to define the enumerated type (used by all files)
58 #define VERBOSE_PREAMBLE \
59 enum VerboseMask {
60 #define VERBOSE_POSTAMBLE \
61 VB_LAST_ITEM \
62 };
63 #define VERBOSE_MAP(name,mask,additive,help) \
64 name = (mask),
65
66#define LOGLEVEL_PREAMBLE \
67 enum LogLevel_t : std::int8_t {
68#define LOGLEVEL_POSTAMBLE \
69 };
70#define LOGLEVEL_MAP(name,value,shortname) \
71 name = (value),
72
73#endif
74
75// NOLINTEND(cppcoreguidelines-macro-usage)
76
78VERBOSE_MAP(VB_ALL, ~0ULL, false,
79 "ALL available debug output")
80VERBOSE_MAP(VB_MOST, 0xffffffff3ffeffffULL, false,
81 "Most debug (nodatabase,notimestamp,noextra)")
82#if 0
83VERBOSE_MAP(VB_IMPORTANT, 0x00000001, false,
84 "Errors or other very important messages")
85#endif
86VERBOSE_MAP(VB_GENERAL, 0x00000002, true,
87 "General info")
88VERBOSE_MAP(VB_RECORD, 0x00000004, true,
89 "Recording related messages")
90VERBOSE_MAP(VB_PLAYBACK, 0x00000008, true,
91 "Playback related messages")
92VERBOSE_MAP(VB_CHANNEL, 0x00000010, true,
93 "Channel related messages")
94VERBOSE_MAP(VB_OSD, 0x00000020, true,
95 "On-Screen Display related messages")
96VERBOSE_MAP(VB_FILE, 0x00000040, true,
97 "File and AutoExpire related messages")
98VERBOSE_MAP(VB_SCHEDULE, 0x00000080, true,
99 "Scheduling related messages")
100VERBOSE_MAP(VB_NETWORK, 0x00000100, true,
101 "Network protocol related messages")
102VERBOSE_MAP(VB_COMMFLAG, 0x00000200, true,
103 "Commercial detection related messages")
104VERBOSE_MAP(VB_AUDIO, 0x00000400, true,
105 "Audio related messages")
106VERBOSE_MAP(VB_LIBAV, 0x00000800, true,
107 "Enables libav debugging")
108VERBOSE_MAP(VB_JOBQUEUE, 0x00001000, true,
109 "JobQueue related messages")
110VERBOSE_MAP(VB_SIPARSER, 0x00002000, true,
111 "Siparser related messages")
112VERBOSE_MAP(VB_EIT, 0x00004000, true,
113 "EIT related messages")
114VERBOSE_MAP(VB_VBI, 0x00008000, true,
115 "VBI related messages")
116VERBOSE_MAP(VB_DATABASE, 0x00010000, true,
117 "Display all SQL commands executed")
118VERBOSE_MAP(VB_DSMCC, 0x00020000, true,
119 "DSMCC carousel related messages")
120VERBOSE_MAP(VB_MHEG, 0x00040000, true,
121 "MHEG debugging messages")
122VERBOSE_MAP(VB_UPNP, 0x00080000, true,
123 "UPnP debugging messages")
124VERBOSE_MAP(VB_SOCKET, 0x00100000, true,
125 "socket debugging messages")
126VERBOSE_MAP(VB_XMLTV, 0x00200000, true,
127 "xmltv output and related messages")
128VERBOSE_MAP(VB_DVBCAM, 0x00400000, true,
129 "DVB CAM debugging messages")
130VERBOSE_MAP(VB_MEDIA, 0x00800000, true,
131 "Media Manager debugging messages")
132VERBOSE_MAP(VB_IDLE, 0x01000000, true,
133 "System idle messages")
134VERBOSE_MAP(VB_CHANSCAN, 0x02000000, true,
135 "Channel Scanning messages")
136VERBOSE_MAP(VB_GUI, 0x04000000, true,
137 "GUI related messages")
138VERBOSE_MAP(VB_SYSTEM, 0x08000000, true,
139 "External executable related messages")
140#if 0
141VERBOSE_MAP(VB_EXTRA, 0x40000000, true,
142 "More detailed messages in selected levels")
143#endif
144VERBOSE_MAP(VB_TIMESTAMP, 0x80000000, true,
145 "Conditional data driven messages")
146VERBOSE_MAP(VB_PROCESS, 0x100000000ULL, true,
147 "MPEG2Fix processing messages")
148VERBOSE_MAP(VB_FRAME, 0x200000000ULL, true,
149 "MPEG2Fix frame messages")
150VERBOSE_MAP(VB_RPLXQUEUE, 0x400000000ULL, true,
151 "MPEG2Fix Replex Queue messages")
152VERBOSE_MAP(VB_DECODE, 0x800000000ULL, true,
153 "MPEG2Fix Decode messages")
154VERBOSE_MAP(VB_FLUSH, 0x1000000000ULL, true,
155 "")
156/* Please do not add a description for VB_FLUSH, it
157 should not be passed in via "-v". It is used to
158 flush output to the standard output from console
159 programs that have debugging enabled.
160 */
161VERBOSE_MAP(VB_STDIO, 0x2000000000ULL, true,
162 "")
163/* Please do not add a description for VB_STDIO, it
164 should not be passed in via "-v". It is used to
165 send output to the standard output from console
166 programs that have debugging enabled.
167 */
168VERBOSE_MAP(VB_GPU, 0x4000000000ULL, true,
169 "GPU OpenGL driver messages")
170VERBOSE_MAP(VB_GPUAUDIO, 0x8000000000ULL, true,
171 "GPU Audio Processing messages")
172VERBOSE_MAP(VB_GPUVIDEO, 0x10000000000ULL, true,
173 "GPU video rendering messages")
174VERBOSE_MAP(VB_REFCOUNT, 0x20000000000ULL, true,
175 "Reference Count messages")
176VERBOSE_MAP(VB_HTTP, 0x40000000000ULL, true,
177 "HTTP Server messages")
178VERBOSE_MAP(VB_LIRC, 0x80000000000ULL, true,
179 "LIRC Client messages")
180VERBOSE_MAP(VB_NONE, 0x00000000, false,
181 "NO debug output")
183
184
186LOGLEVEL_MAP(LOG_ANY, -1, ' ')
187LOGLEVEL_MAP(LOG_EMERG, 0, '!')
188LOGLEVEL_MAP(LOG_ALERT, 1, 'A')
189LOGLEVEL_MAP(LOG_CRIT, 2, 'C')
190LOGLEVEL_MAP(LOG_ERR, 3, 'E')
191LOGLEVEL_MAP(LOG_WARNING, 4, 'W')
192LOGLEVEL_MAP(LOG_NOTICE, 5, 'N')
193LOGLEVEL_MAP(LOG_INFO, 6, 'I')
194LOGLEVEL_MAP(LOG_DEBUG, 7, 'D')
195LOGLEVEL_MAP(LOG_TRACE, 8, 'T')
196LOGLEVEL_MAP(LOG_UNKNOWN, 9, '-')
198
199#ifndef MYTH_IMPLEMENT_VERBOSE
200#ifdef __cplusplus
202 uint64_t mask {0};
203 QString name;
204 bool additive {false};
205 QString helpText;
206};
207using VerboseMap = QMap<QString, VerboseDef *>;
208
210 int value {LOG_UNKNOWN};
211 QString name;
212 char shortname {'-'};
213};
214using LoglevelMap = QMap<int, LoglevelDef *>;
215using ComponentLogLevelMap = QMap<uint64_t, LogLevel_t>;
216
218extern QMutex verboseMapMutex;
219
221extern QMutex loglevelMapMutex;
222#endif
223#endif
224
225#endif
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:60
Interface between mythtv and lircd.
Definition: lirc.h:26
Definition: freemheg.h:61
#define D(i, j)
static bool Recording(const RecordingInfo *p)
Definition: scheduler.cpp:226
QString name
Definition: verbosedefs.h:211
char shortname
Definition: verbosedefs.h:212
uint64_t mask
Definition: verbosedefs.h:202
bool additive
Definition: verbosedefs.h:204
QString helpText
Definition: verbosedefs.h:205
QString name
Definition: verbosedefs.h:203
#define output
#define LOGLEVEL_MAP(name, value, shortname)
Definition: verbosedefs.h:70
QMutex verboseMapMutex
Definition: logging.cpp:93
#define LOGLEVEL_PREAMBLE
Definition: verbosedefs.h:66
QMap< uint64_t, LogLevel_t > ComponentLogLevelMap
Definition: verbosedefs.h:215
LoglevelMap loglevelMap
Definition: logging.cpp:95
QMap< int, LoglevelDef * > LoglevelMap
Definition: verbosedefs.h:214
#define VERBOSE_MAP(name, mask, additive, help)
Definition: verbosedefs.h:63
QMap< QString, VerboseDef * > VerboseMap
Definition: verbosedefs.h:207
#define LOGLEVEL_POSTAMBLE
Definition: verbosedefs.h:68
QMutex loglevelMapMutex
Definition: logging.cpp:96
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:86
VERBOSE_PREAMBLE Most debug(nodatabase, notimestamp, noextra)") VERBOSE_MAP(VB_GENERAL
#define VERBOSE_PREAMBLE
This file gets included in two different ways: 1) from mythlogging.h from nearly every file.
Definition: verbosedefs.h:58
#define VERBOSE_POSTAMBLE
Definition: verbosedefs.h:60
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:80
VerboseMap verboseMap
Definition: logging.cpp:92