The AutoTrace
Class Reference
Helper class to trace an entry statement at creation and another one at destruction. More...
Declaration
class AutoTrace { ... }
Included Headers
#include <src/trace.h>
Public Constructors Index
AutoTrace (spdlog::source_loc loc) | |
template <typename... Args> | |
AutoTrace (spdlog::source_loc loc, const std::string &fmt, Args &&...args) | |
Public Destructor Index
~AutoTrace () | |
Public Member Functions Index
template <typename... Args> | |
void | add (spdlog::source_loc loc, const std::string &fmt, Args &&...args) |
template <typename... Args> | |
void | setExit (spdlog::source_loc loc, const std::string &msg, Args &&...args) |
Private Member Attributes Index
spdlog::source_loc | m_loc |
std::string | m_exitMessage |
Description
Helper class to trace an entry statement at creation and another one at destruction.
Definition at line 81 of file trace.h.
Public Constructors
AutoTrace()
| inline explicit |
AutoTrace()
Public Destructor
~AutoTrace()
| inline |
Definition at line 107 of file trace.h.
108 {
109 if (g_tracer)
110 {
111 if (m_exitMessage.empty())
112 {
114 }
115 else
116 {
117 g_tracer->log(m_loc,spdlog::level::trace,"< "+m_exitMessage);
118 }
119 }
120 }
References g_tracer, m_exitMessage and m_loc.
Public Member Functions
add()
template <typename... Args>
| inline |
setExit()
template <typename... Args>
| inline |
Definition at line 133 of file trace.h.
134 const std::string &msg,Args&&...args)
135 {
136 m_loc = loc;
137 m_exitMessage = fmt::format(fmt::runtime(msg),std::forward<Args>(args)...);
138 }
References m_exitMessage, m_loc and msg.
Private Member Attributes
m_exitMessage
|
Definition at line 141 of file trace.h.
141 std::string m_exitMessage;
Referenced by setExit and ~AutoTrace.
m_loc
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus by Doxygen 1.14.0.