Doxygen
Loading...
Searching...
No Matches
trace.h File Reference
#include "spdlog/spdlog.h"
#include "types.h"
#include "qcstring.h"
#include "construct.h"
+ Include dependency graph for trace.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AutoTrace
 Helper class to trace an entry statement at creation and another one at destruction. More...
 
struct  fmt::formatter< T >
 
struct  fmt::formatter< QCString >
 adds support for formatting QCString More...
 
struct  fmt::formatter< Protection >
 adds support for formatting Protected More...
 
struct  fmt::formatter< Specifier >
 adds support for formatting Specifier More...
 
struct  fmt::formatter< MethodTypes >
 adds support for formatting MethodTypes More...
 
struct  fmt::formatter< RelatesType >
 adds support for formatting RelatesType More...
 
struct  fmt::formatter< Relationship >
 adds support for formatting RelationShip More...
 
struct  fmt::formatter< SrcLangExt >
 adds support for formatting SrcLangExt More...
 
struct  fmt::formatter< MemberType >
 adds support for formatting MemberType More...
 
struct  fmt::formatter< TypeSpecifier >
 adds support for formatting TypeSpecifier More...
 
struct  fmt::formatter< EntryType >
 adds support for formatting EntryType More...
 
struct  fmt::formatter< MemberListType >
 adds support for formatting MemberListType More...
 

Namespaces

namespace  Trace
 
namespace  fmt
 

Macros

#define ENABLE_TRACING   1
 
#define ENABLE_SYMBOLRESOLVER_TRACING   0
 
#define ENABLE_MARKDOWN_TRACING   0
 
#define ENABLE_DOCPARSER_TRACING   0
 
#define SPELOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO
 
#define TRACE(...)
 
#define AUTO_TRACE(...)
 
#define AUTO_TRACE_ADD(...)
 
#define AUTO_TRACE_EXIT(...)
 

Functions

void initTracing (const QCString &logFile, bool timing)
 
void exitTracing ()
 
QCString Trace::trunc (const QCString &s, size_t numChars=15)
 

Variables

std::shared_ptr< spdlog::logger > g_tracer
 

Macro Definition Documentation

◆ AUTO_TRACE

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

Definition at line 147 of file trace.h.

◆ AUTO_TRACE_ADD

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

Definition at line 148 of file trace.h.

◆ AUTO_TRACE_EXIT

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

Definition at line 149 of file trace.h.

◆ ENABLE_DOCPARSER_TRACING

#define ENABLE_DOCPARSER_TRACING   0

Definition at line 31 of file trace.h.

◆ ENABLE_MARKDOWN_TRACING

#define ENABLE_MARKDOWN_TRACING   0

Definition at line 30 of file trace.h.

◆ ENABLE_SYMBOLRESOLVER_TRACING

#define ENABLE_SYMBOLRESOLVER_TRACING   0

Definition at line 29 of file trace.h.

◆ ENABLE_TRACING

#define ENABLE_TRACING   1

Definition at line 21 of file trace.h.

◆ SPELOG_ACTIVE_LEVEL

#define SPELOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO

Definition at line 37 of file trace.h.

◆ TRACE

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

Definition at line 77 of file trace.h.

Referenced by computeVerifiedDotPath(), and readConfiguration().

Function Documentation

◆ exitTracing()

void exitTracing ( )

Definition at line 52 of file trace.cpp.

53{
54 if (g_tracer)
55 {
56 spdlog::shutdown();
57 }
58}
std::shared_ptr< spdlog::logger > g_tracer
Definition trace.cpp:20

References g_tracer.

Referenced by generateOutput(), and stopDoxygen().

◆ initTracing()

void initTracing ( const QCString & logFile,
bool timing )

Definition at line 22 of file trace.cpp.

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}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:526

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

Referenced by readConfiguration().

Variable Documentation

◆ g_tracer

std::shared_ptr<spdlog::logger> g_tracer
extern