Thrill  0.1
LoggerCollectOutput Class Reference

Detailed Description

Class to hook logger output in the local thread.

Definition at line 201 of file core.hpp.

+ Inheritance diagram for LoggerCollectOutput:
+ Collaboration diagram for LoggerCollectOutput:

#include <core.hpp>

Public Member Functions

 LoggerCollectOutput (bool echo=false)
 
 ~LoggerCollectOutput ()
 
void append_log_line (const std::string &line) final
 method the receive log lines More...
 
void clear ()
 clear transcript More...
 
std::string get ()
 return transcript of log More...
 
- Public Member Functions inherited from LoggerOutputHook
virtual ~LoggerOutputHook ()
 virtual destructor More...
 

Protected Attributes

bool echo_
 whether to echo each line to next logger output More...
 
LoggerOutputHooknext_
 previous logger, will be restored by destructor More...
 
std::ostringstream oss_
 string stream collecting More...
 

Constructor & Destructor Documentation

◆ LoggerCollectOutput()

LoggerCollectOutput ( bool  echo = false)
explicit

Definition at line 118 of file core.cpp.

References LoggerCollectOutput::next_, and tlx::set_logger_output_hook().

◆ ~LoggerCollectOutput()

Member Function Documentation

◆ append_log_line()

void append_log_line ( const std::string &  line)
finalvirtual

method the receive log lines

Implements LoggerOutputHook.

Definition at line 136 of file core.cpp.

References LoggerOutputHook::append_log_line(), LoggerCollectOutput::echo_, LoggerCollectOutput::next_, and LoggerCollectOutput::oss_.

◆ clear()

void clear ( )

clear transcript

Definition at line 128 of file core.cpp.

References LoggerCollectOutput::oss_.

◆ get()

std::string get ( )

return transcript of log

Definition at line 132 of file core.cpp.

References LoggerCollectOutput::oss_.

Member Data Documentation

◆ echo_

bool echo_
protected

whether to echo each line to next logger output

Definition at line 221 of file core.hpp.

Referenced by LoggerCollectOutput::append_log_line().

◆ next_

LoggerOutputHook* next_
protected

previous logger, will be restored by destructor

Definition at line 218 of file core.hpp.

Referenced by LoggerCollectOutput::append_log_line(), LoggerCollectOutput::LoggerCollectOutput(), and LoggerCollectOutput::~LoggerCollectOutput().

◆ oss_

std::ostringstream oss_
protected

string stream collecting

Definition at line 224 of file core.hpp.

Referenced by LoggerCollectOutput::append_log_line(), LoggerCollectOutput::clear(), and LoggerCollectOutput::get().


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