Skip to main content

The Debug Class Reference

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

Declaration

class Debug { ... }

Included Headers

#include <src/debug.h>

Enumerations Index

enumDebugMask : uint64_t { ... }

Public Static Functions Index

static voidprint_ (DebugMask mask, int prio, fmt::string_view fmt, fmt::format_args args)
template <typename ... Args>
static voidprint (DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
static boolsetFlagStr (const QCString &label)
static voidsetFlag (const DebugMask mask)
static voidclearFlag (const DebugMask mask)
static boolisFlagSet (const DebugMask mask)
static voidprintFlags ()
static voidsetPriority (int p)
static voidstartTimer ()
static doubleelapsedTime ()

Private Static Attributes Index

static DebugMaskcurMask = Debug::Quiet
static intcurPrio = 0

Description

Class containing a print function for diagnostics.

Definition at line 25 of file debug.h.

Enumerations

DebugMask

enum Debug::DebugMask : uint64_t
Enumeration values
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)

Definition at line 28 of file debug.h.

28 enum DebugMask : 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 };

Public Static Functions

clearFlag()

void Debug::clearFlag (const DebugMask mask)
static

Declaration at line 83 of file debug.h, definition at line 122 of file debug.cpp.

123{
124 curMask = static_cast<DebugMask>(curMask & ~mask);
125}

Reference curMask.

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

elapsedTime()

double Debug::elapsedTime ()
static

Declaration at line 89 of file debug.h, definition at line 201 of file debug.cpp.

202{
203 return g_runningTime.elapsedTimeS();
204}

Reference 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

Declaration at line 73 of file debug.h, definition at line 81 of file debug.cpp.

81void Debug::print_(DebugMask mask, int prio, fmt::string_view fmt, fmt::format_args args)
82{
83 if ((curMask&mask) && prio<=curPrio)
84 {
85 fmt::print(g_debugFile,"{}",fmt::vformat(fmt,args));
86 }
87}

References curMask, curPrio and g_debugFile.

Referenced by print.

printFlags()

void Debug::printFlags ()
static

Declaration at line 85 of file debug.h, 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}

References msg and s_labels.

Referenced by devUsage.

setFlag()

void Debug::setFlag (const DebugMask mask)
static

Declaration at line 82 of file debug.h, definition at line 117 of file debug.cpp.

117void Debug::setFlag(const DebugMask mask)
118{
119 curMask = static_cast<DebugMask>(curMask | mask);
120}

Reference curMask.

Referenced by generateOutput and Statistics::print.

setFlagStr()

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

Declaration at line 81 of file debug.h, 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}

References curMask, g_debugFile, labelToEnumValue and Stderr.

Referenced by readConfiguration.

setPriority()

void Debug::setPriority (int p)
static

Declaration at line 86 of file debug.h, definition at line 127 of file debug.cpp.

128{
129 curPrio = p;
130}

Reference curPrio.

startTimer()

void Debug::startTimer ()
static

Declaration at line 88 of file debug.h, definition at line 196 of file debug.cpp.

197{
198 g_runningTime.start();
199}

Reference g_runningTime.

Referenced by initDoxygen.

Private Static Attributes

curMask

Debug::DebugMask Debug::curMask = Debug::Quiet
static

Definition at line 92 of file debug.h.

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

curPrio

int Debug::curPrio = 0
static

Definition at line 93 of file debug.h.

93 static int curPrio;

Referenced by print_ and setPriority.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.