Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
TracerOutput.h
Go to the documentation of this file.
1 #pragma once
2 
8 #include <string>
9 
11 #define COMP_MISC_TRACER_OUTPUT_ON UA_CoMP::Misc::g_tracer_log.set_output_on()
12 
14 #define COMP_MISC_TRACER_OUTPUT_OFF UA_CoMP::Misc::g_tracer_log.set_output_off()
15 
17 #define COMP_MISC_LOG_TRACER(MSG) UA_CoMP::Misc::g_tracer_log.log(MSG)
18 
19 namespace UA_CoMP {
20 namespace Misc {
21 
30 {
31 public:
33  TracerOutput() = default;
34 
36  bool is_output_on();
37 
39  void set_output_on();
40 
42  void set_output_off();
43 
45  void increase_indent();
46 
48  void decrease_indent();
49 
51  void log(const std::string& msg);
52 
53 private:
54  bool m_make_output{true};
55  unsigned int m_indent{0};
56 };
57 
59 extern TracerOutput g_tracer_log;
60 
61 } // namespace Misc
62 } // namespace UA_CoMP
TracerOutput g_tracer_log
TracerOutput instance connected to g3log default logger.
TracerOutput()=default
No constructor.
void set_output_off()
Stop making output (ok even if output already stopped).
void decrease_indent()
Decrease the indentation level.
Class used to channel output of the BlockTracer, FunctionTracer and MemberTracer objects to the g3log...
Definition: TracerOutput.h:29
void log(const std::string &msg)
Insert the message in the google log at given severity level.
bool is_output_on()
Indicate whether current making output.
void increase_indent()
Increase the indentation level.
void set_output_on()
Start making output (ok even output already started).