Doxygen
Loading...
Searching...
No Matches
Debug Class Reference

Class containing a print function for diagnostics. More...

#include <src/debug.h>

Public Types

enum  DebugMask : uint64_t {
  Quiet = 0x00'0000ULL , Preprocessor = 0x00'0001ULL , CommentCnv = 0x00'0002ULL , CommentScan = 0x00'0004ULL ,
  Formula = 0x00'0008ULL , PrintTree = 0x00'0010ULL , Time = 0x00'0020ULL , ExtCmd = 0x00'0040ULL ,
  Markdown = 0x00'0080ULL , FilterOutput = 0x00'0100ULL , Plantuml = 0x00'0200ULL , FortranFixed2Free = 0x00'0400ULL ,
  Cite = 0x00'0800ULL , NoLineNo = 0x00'1000ULL , Rtf = 0x00'2000ULL , Qhp = 0x00'4000ULL ,
  Tag = 0x00'8000ULL , Alias = 0x01'0000ULL , Entries = 0x02'0000ULL , Sections = 0x04'0000ULL ,
  Stderr = 0x08'0000ULL , Layout = 0x10'0000ULL , Lex = 0x0000'FFFF'FF00'0000ULL , Lex_code = 0x0000'0000'0100'0000ULL ,
  Lex_commentcnv = 0x0000'0000'0200'0000ULL , Lex_commentscan = 0x0000'0000'0400'0000ULL , Lex_configimpl = 0x0000'0000'0800'0000ULL , Lex_constexp = 0x0000'0000'1000'0000ULL ,
  Lex_declinfo = 0x0000'0000'2000'0000ULL , Lex_defargs = 0x0000'0000'4000'0000ULL , Lex_doctokenizer = 0x0000'0000'8000'0000ULL , Lex_fortrancode = 0x0000'0001'0000'0000ULL ,
  Lex_fortranscanner = 0x0000'0002'0000'0000ULL , Lex_lexcode = 0x0000'0004'0000'0000ULL , Lex_lexscanner = 0x0000'0008'0000'0000ULL , Lex_pre = 0x0000'0010'0000'0000ULL ,
  Lex_pycode = 0x0000'0020'0000'0000ULL , Lex_pyscanner = 0x0000'0040'0000'0000ULL , Lex_scanner = 0x0000'0080'0000'0000ULL , Lex_sqlcode = 0x0000'0100'0000'0000ULL ,
  Lex_vhdlcode = 0x0000'0200'0000'0000ULL , Lex_xml = 0x0000'0400'0000'0000ULL , Lex_xmlcode = 0x0000'0800'0000'0000ULL
}
 

Static Public Member Functions

static void print (DebugMask mask, int prio, const char *fmt,...)
 
static bool setFlagStr (const QCString &label)
 
static void setFlag (const DebugMask mask)
 
static void clearFlag (const DebugMask mask)
 
static bool isFlagSet (const DebugMask mask)
 
static void printFlags ()
 
static void setPriority (int p)
 
static void startTimer ()
 
static double elapsedTime ()
 

Static Private Attributes

static DebugMask curMask = Debug::Quiet
 
static int curPrio = 0
 

Detailed Description

Class containing a print function for diagnostics.

Definition at line 24 of file debug.h.

Member Enumeration Documentation

◆ DebugMask

enum Debug::DebugMask : uint64_t
Enumerator
Quiet 
Preprocessor 
CommentCnv 
CommentScan 
Formula 
PrintTree 
Time 
ExtCmd 
Markdown 
FilterOutput 
Plantuml 
FortranFixed2Free 
Cite 
NoLineNo 
Rtf 
Qhp 
Tag 
Alias 
Entries 
Sections 
Stderr 
Layout 
Lex 
Lex_code 
Lex_commentcnv 
Lex_commentscan 
Lex_configimpl 
Lex_constexp 
Lex_declinfo 
Lex_defargs 
Lex_doctokenizer 
Lex_fortrancode 
Lex_fortranscanner 
Lex_lexcode 
Lex_lexscanner 
Lex_pre 
Lex_pycode 
Lex_pyscanner 
Lex_scanner 
Lex_sqlcode 
Lex_vhdlcode 
Lex_xml 
Lex_xmlcode 

Definition at line 27 of file debug.h.

27 : uint64_t {
28 Quiet = 0x00'0000ULL,
29 Preprocessor = 0x00'0001ULL,
30 CommentCnv = 0x00'0002ULL,
31 CommentScan = 0x00'0004ULL,
32 Formula = 0x00'0008ULL,
33 PrintTree = 0x00'0010ULL,
34 Time = 0x00'0020ULL,
35 ExtCmd = 0x00'0040ULL,
36 Markdown = 0x00'0080ULL,
37 FilterOutput = 0x00'0100ULL,
38 Plantuml = 0x00'0200ULL,
39 FortranFixed2Free = 0x00'0400ULL,
40 Cite = 0x00'0800ULL,
41 NoLineNo = 0x00'1000ULL,
42 Rtf = 0x00'2000ULL,
43 Qhp = 0x00'4000ULL,
44 Tag = 0x00'8000ULL,
45 Alias = 0x01'0000ULL,
46 Entries = 0x02'0000ULL,
47 Sections = 0x04'0000ULL,
48 Stderr = 0x08'0000ULL,
49 Layout = 0x10'0000ULL,
50 Lex = 0x0000'FFFF'FF00'0000ULL, // all scanners combined
51 Lex_code = 0x0000'0000'0100'0000ULL,
52 Lex_commentcnv = 0x0000'0000'0200'0000ULL,
53 Lex_commentscan = 0x0000'0000'0400'0000ULL,
54 Lex_configimpl = 0x0000'0000'0800'0000ULL,
55 Lex_constexp = 0x0000'0000'1000'0000ULL,
56 Lex_declinfo = 0x0000'0000'2000'0000ULL,
57 Lex_defargs = 0x0000'0000'4000'0000ULL,
58 Lex_doctokenizer = 0x0000'0000'8000'0000ULL,
59 Lex_fortrancode = 0x0000'0001'0000'0000ULL,
60 Lex_fortranscanner= 0x0000'0002'0000'0000ULL,
61 Lex_lexcode = 0x0000'0004'0000'0000ULL,
62 Lex_lexscanner = 0x0000'0008'0000'0000ULL,
63 Lex_pre = 0x0000'0010'0000'0000ULL,
64 Lex_pycode = 0x0000'0020'0000'0000ULL,
65 Lex_pyscanner = 0x0000'0040'0000'0000ULL,
66 Lex_scanner = 0x0000'0080'0000'0000ULL,
67 Lex_sqlcode = 0x0000'0100'0000'0000ULL,
68 Lex_vhdlcode = 0x0000'0200'0000'0000ULL,
69 Lex_xml = 0x0000'0400'0000'0000ULL,
70 Lex_xmlcode = 0x0000'0800'0000'0000ULL
71 };
@ Lex_fortranscanner
Definition debug.h:60
@ Lex_doctokenizer
Definition debug.h:58
@ Lex
Definition debug.h:50
@ Rtf
Definition debug.h:42
@ NoLineNo
Definition debug.h:41
@ Lex_pre
Definition debug.h:63
@ Lex_defargs
Definition debug.h:57
@ Alias
Definition debug.h:45
@ Lex_pycode
Definition debug.h:64
@ Layout
Definition debug.h:49
@ Markdown
Definition debug.h:36
@ Lex_declinfo
Definition debug.h:56
@ Tag
Definition debug.h:44
@ Lex_lexscanner
Definition debug.h:62
@ FilterOutput
Definition debug.h:37
@ Lex_sqlcode
Definition debug.h:67
@ Lex_code
Definition debug.h:51
@ Lex_pyscanner
Definition debug.h:65
@ Cite
Definition debug.h:40
@ ExtCmd
Definition debug.h:35
@ Sections
Definition debug.h:47
@ PrintTree
Definition debug.h:33
@ Time
Definition debug.h:34
@ Quiet
Definition debug.h:28
@ Lex_xml
Definition debug.h:69
@ Stderr
Definition debug.h:48
@ Plantuml
Definition debug.h:38
@ Formula
Definition debug.h:32
@ Lex_commentcnv
Definition debug.h:52
@ Lex_vhdlcode
Definition debug.h:68
@ Lex_constexp
Definition debug.h:55
@ Lex_xmlcode
Definition debug.h:70
@ Lex_fortrancode
Definition debug.h:59
@ Lex_commentscan
Definition debug.h:53
@ Lex_lexcode
Definition debug.h:61
@ Qhp
Definition debug.h:43
@ Entries
Definition debug.h:46
@ Lex_configimpl
Definition debug.h:54
@ Preprocessor
Definition debug.h:29
@ Lex_scanner
Definition debug.h:66
@ CommentCnv
Definition debug.h:30
@ FortranFixed2Free
Definition debug.h:39
@ CommentScan
Definition debug.h:31

Member Function Documentation

◆ clearFlag()

void Debug::clearFlag ( const DebugMask mask)
static

Definition at line 125 of file debug.cpp.

126{
127 curMask = static_cast<DebugMask>(curMask & ~mask);
128}
DebugMask
Definition debug.h:27
static DebugMask curMask
Definition debug.h:85

References curMask.

Referenced by devUsage(), generateOutput(), Statistics::print(), usage(), and version().

◆ elapsedTime()

double Debug::elapsedTime ( )
static

Definition at line 204 of file debug.cpp.

205{
207}
double elapsedTimeS()
Definition debug.cpp:186
static Timer g_runningTime
Definition debug.cpp:197

References Timer::elapsedTimeS(), and g_runningTime.

Referenced by generateOutput(), and msg().

◆ isFlagSet()

◆ print()

◆ printFlags()

void Debug::printFlags ( )
static

Definition at line 140 of file debug.cpp.

141{
142 for (const auto &v : s_labels)
143 {
144 msg("\t%s\n",v.first.c_str());
145 }
146}
static std::map< std::string, Debug::DebugMask > s_labels
Definition debug.cpp:29
void msg(const char *fmt,...)
Definition message.cpp:98

References msg(), and s_labels.

Referenced by devUsage().

◆ setFlag()

void Debug::setFlag ( const DebugMask mask)
static

Definition at line 120 of file debug.cpp.

121{
122 curMask = static_cast<DebugMask>(curMask | mask);
123}

References curMask.

Referenced by generateOutput(), and Statistics::print().

◆ setFlagStr()

bool Debug::setFlagStr ( const QCString & label)
static

Definition at line 106 of file debug.cpp.

107{
108 uint64_t retVal = labelToEnumValue(lab);
109 if (retVal == Debug::Stderr)
110 {
111 g_debugFile = stderr;
112 }
113 else
114 {
115 curMask = static_cast<DebugMask>(curMask | retVal);
116 }
117 return retVal!=0;
118}
static uint64_t labelToEnumValue(const QCString &l)
Definition debug.cpp:98

References curMask, g_debugFile, labelToEnumValue(), and Stderr.

Referenced by readConfiguration().

◆ setPriority()

void Debug::setPriority ( int p)
static

Definition at line 130 of file debug.cpp.

131{
132 curPrio = p;
133}

References curPrio.

◆ startTimer()

void Debug::startTimer ( )
static

Definition at line 199 of file debug.cpp.

200{
202}
void start()
Definition debug.cpp:182

References g_runningTime, and Timer::start().

Referenced by initDoxygen().

Member Data Documentation

◆ curMask

Debug::DebugMask Debug::curMask = Debug::Quiet
staticprivate

Definition at line 85 of file debug.h.

Referenced by clearFlag(), isFlagSet(), print(), setFlag(), and setFlagStr().

◆ curPrio

int Debug::curPrio = 0
staticprivate

Definition at line 86 of file debug.h.

Referenced by print(), and setPriority().


The documentation for this class was generated from the following files: