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