Back to index

nux  3.0.0
Public Member Functions | Private Attributes
nux::logging::BlockTracer Class Reference

This class is used to log the entry and exit of a block. More...

#include <Logger.h>

Collaboration diagram for nux::logging::BlockTracer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BlockTracer (Logger &logger, Level level, std::string const &function_name, std::string const &filename, int line_number)
 ~BlockTracer ()

Private Attributes

Loggerlogger_
Level level_
std::string function_name_
std::string filename_
int line_number_

Detailed Description

This class is used to log the entry and exit of a block.

Entry is defined as where the object is created. This is most likely going to be defined using the macros defined above. Exit is defined as object destruction, which is normally controlled through the end of scope killing the stack object.

int some_func(params...) { LOG_TRACE_BLOCK(logger); ... }

Definition at line 150 of file Logger.h.


Constructor & Destructor Documentation

nux::logging::BlockTracer::BlockTracer ( Logger logger,
Level  level,
std::string const &  function_name,
std::string const &  filename,
int  line_number 
)

Definition at line 414 of file Logger.cpp.

  : logger_(logger)
  , level_(level)
  , function_name_(function_name)
  , filename_(filename)
  , line_number_(line_number)
{
  if (logger_.GetEffectiveLogLevel() <= level_)
  {
    LogStream(level_, logger_.module(), filename_, line_number_).stream()
      << "+" << function_name_;
  }
}

Here is the call graph for this function:

Definition at line 432 of file Logger.cpp.

{
  if (logger_.GetEffectiveLogLevel() <= level_)
  {
    LogStream(level_, logger_.module(), filename_, line_number_).stream()
      << "-" << function_name_;
  }
}

Here is the call graph for this function:


Member Data Documentation

std::string nux::logging::BlockTracer::filename_ [private]

Definition at line 163 of file Logger.h.

Definition at line 162 of file Logger.h.

Definition at line 161 of file Logger.h.

Definition at line 164 of file Logger.h.

Definition at line 160 of file Logger.h.


The documentation for this class was generated from the following files: