Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
TracerOutput.cpp
Go to the documentation of this file.
1 
7 #include "tracer/TracerOutput.h"
8 #include <g3log/g3log.hpp>
9 
10 namespace UA_CoMP {
11 namespace Misc {
12 
13 using namespace std;
14 
16 
17 bool TracerOutput::is_output_on() { return m_make_output; }
18 
19 void TracerOutput::set_output_on() { m_make_output = true; }
20 
21 void TracerOutput::set_output_off() { m_make_output = false; }
22 
23 void TracerOutput::increase_indent() { m_indent++; }
24 
25 void TracerOutput::decrease_indent() { m_indent--; }
26 
27 void TracerOutput::log(const string& msg)
28 {
29  if (is_output_on()) {
30  ostringstream os;
31  for (unsigned int i = 0; i < m_indent; ++i) {
32  os << " ";
33  }
34  os << msg;
35  LOG(INFO) << os.str();
36  }
37 }
38 
39 } // namespace Misc
40 } // namespace UA_CoMP
TracerOutput g_tracer_log
TracerOutput instance connected to g3log default logger.
void set_output_off()
Stop making output (ok even if output already stopped).
void decrease_indent()
Decrease the indentation level.
Header for TracerOutput.
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).