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, fmt::string_view fmt, fmt::format_args args)
 
template<typename ... Args>
static void print (DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
 
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 25 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 28 of file debug.h.

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

Member Function Documentation

◆ clearFlag()

void Debug::clearFlag ( const DebugMask mask)
static

Definition at line 122 of file debug.cpp.

123{
124 curMask = static_cast<DebugMask>(curMask & ~mask);
125}
DebugMask
Definition debug.h:28
static DebugMask curMask
Definition debug.h:92

References curMask.

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

◆ elapsedTime()

double Debug::elapsedTime ( )
static

Definition at line 201 of file debug.cpp.

202{
204}
double elapsedTimeS()
Definition debug.cpp:183
static Timer g_runningTime
Definition debug.cpp:194

References g_runningTime.

Referenced by generateOutput(), and msg_().

◆ isFlagSet()

◆ print()

◆ print_()

void Debug::print_ ( DebugMask mask,
int prio,
fmt::string_view fmt,
fmt::format_args args )
static

Definition at line 81 of file debug.cpp.

82{
83 if ((curMask&mask) && prio<=curPrio)
84 {
85 fmt::print(g_debugFile,"{}",fmt::vformat(fmt,args));
86 }
87}
static int curPrio
Definition debug.h:93
static FILE * g_debugFile
Definition debug.cpp:76

References curMask, curPrio, and g_debugFile.

Referenced by print().

◆ printFlags()

void Debug::printFlags ( )
static

Definition at line 137 of file debug.cpp.

138{
139 for (const auto &v : s_labels)
140 {
141 msg("\t{}\n",v.first);
142 }
143}
static std::map< std::string, Debug::DebugMask > s_labels
Definition debug.cpp:29
#define msg(fmt,...)
Definition message.h:94

References msg, and s_labels.

Referenced by devUsage().

◆ setFlag()

void Debug::setFlag ( const DebugMask mask)
static

Definition at line 117 of file debug.cpp.

118{
119 curMask = static_cast<DebugMask>(curMask | mask);
120}

References curMask.

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

◆ setFlagStr()

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

Definition at line 103 of file debug.cpp.

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

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

Referenced by readConfiguration().

◆ setPriority()

void Debug::setPriority ( int p)
static

Definition at line 127 of file debug.cpp.

128{
129 curPrio = p;
130}

References curPrio.

◆ startTimer()

void Debug::startTimer ( )
static

Definition at line 196 of file debug.cpp.

197{
199}
void start()
Definition debug.cpp:179

References g_runningTime.

Referenced by initDoxygen().

Member Data Documentation

◆ curMask

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

Definition at line 92 of file debug.h.

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

◆ curPrio

int Debug::curPrio = 0
staticprivate

Definition at line 93 of file debug.h.

Referenced by print_(), and setPriority().


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