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