Skip to main content

The trace.h File Reference

Included Headers

#include "spdlog/spdlog.h" #include "message.h" #include "qcstring.h" #include "construct.h"

Namespaces Index

namespaceTrace

Classes Index

classAutoTrace

Helper class to trace an entry statement at creation and another one at destruction. More...

Functions Index

voidinitTracing (const QCString &logFile, bool timing)
voidexitTracing ()

Variables Index

std::shared_ptr< spdlog::logger >g_tracer

Macro Definitions Index

#defineENABLE_TRACING   1
#defineENABLE_SYMBOLRESOLVER_TRACING   0
#defineENABLE_MARKDOWN_TRACING   0
#defineENABLE_DOCPARSER_TRACING   0
#defineSPELOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO
#defineTRACE(...)   (void)0
#defineAUTO_TRACE(...)   (void)0
#defineAUTO_TRACE_ADD(...)   (void)0
#defineAUTO_TRACE_EXIT(...)   (void)0

Functions

exitTracing()

void exitTracing ()

Declaration at line 52 of file trace.h, definition at line 52 of file trace.cpp.

53{
54 if (g_tracer)
55 {
56 spdlog::shutdown();
57 }
58}

Reference g_tracer.

Referenced by generateOutput and stopDoxygen.

initTracing()

void initTracing (const QCString & logFile, bool timing)

Declaration at line 51 of file trace.h, definition at line 22 of file trace.cpp.

22void initTracing(const QCString &logFile, bool timing)
23{
24 if (!logFile.isEmpty())
25 {
26 std::vector<spdlog::sink_ptr> sinks;
27 if (logFile=="stdout")
28 {
29 sinks.push_back(std::make_shared<spdlog::sinks::stdout_sink_mt>());
30 }
31 else if (logFile=="stderr")
32 {
33 sinks.push_back(std::make_shared<spdlog::sinks::stderr_sink_mt>());
34 }
35 else // normal file
36 {
37 sinks.push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(logFile.str(),true));
38 }
39 g_tracer = std::make_shared<spdlog::logger>("tracing", sinks.begin(),sinks.end());
40 g_tracer->set_level(spdlog::level::trace);
41 if (timing)
42 {
43 g_tracer->set_pattern("[%C-%m-%d %T.%e][%t][%s:%#](%!) %v");
44 }
45 else
46 {
47 g_tracer->set_pattern("[%s:%#](%!) %v");
48 }
49 }
50}

References g_tracer, QCString::isEmpty and QCString::str.

Referenced by readConfiguration.

Variables

g_tracer

std::shared_ptr<spdlog::logger> g_tracer

Declaration at line 49 of file trace.h, definition at line 20 of file trace.cpp.

20std::shared_ptr<spdlog::logger> g_tracer;

Referenced by AutoTrace::add, AutoTrace::AutoTrace, AutoTrace::AutoTrace, exitTracing, initTracing and AutoTrace::~AutoTrace.

Macro Definitions

AUTO_TRACE

#define AUTO_TRACE(...)   (void)0

Definition at line 149 of file trace.h.

149#define AUTO_TRACE(...) (void)0

AUTO_TRACE_ADD

#define AUTO_TRACE_ADD(...)   (void)0

Definition at line 150 of file trace.h.

150#define AUTO_TRACE_ADD(...) (void)0

AUTO_TRACE_EXIT

#define AUTO_TRACE_EXIT(...)   (void)0

Definition at line 151 of file trace.h.

151#define AUTO_TRACE_EXIT(...) (void)0

ENABLE_DOCPARSER_TRACING

#define ENABLE_DOCPARSER_TRACING   0

Definition at line 31 of file trace.h.

31#define ENABLE_DOCPARSER_TRACING 0

ENABLE_MARKDOWN_TRACING

#define ENABLE_MARKDOWN_TRACING   0

Definition at line 30 of file trace.h.

30#define ENABLE_MARKDOWN_TRACING 0

ENABLE_SYMBOLRESOLVER_TRACING

#define ENABLE_SYMBOLRESOLVER_TRACING   0

Definition at line 29 of file trace.h.

29#define ENABLE_SYMBOLRESOLVER_TRACING 0

ENABLE_TRACING

#define ENABLE_TRACING   1

Definition at line 21 of file trace.h.

21#define ENABLE_TRACING 1

SPELOG_ACTIVE_LEVEL

#define SPELOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO

Definition at line 37 of file trace.h.

37#define SPELOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO // release build (hide trace/debug levels)

TRACE

#define TRACE(...)   (void)0

Definition at line 77 of file trace.h.

77#define TRACE(...) (void)0

Referenced by computeVerifiedDotPath and readConfiguration.


Generated via doxygen2docusaurus by Doxygen 1.14.0.