tlx
Loading...
Searching...
No Matches
LoggerCollectOutput Class Reference

Class to hook logger output in the local thread. More...

#include <core.hpp>

Inheritance diagram for LoggerCollectOutput:
LoggerOutputHook

Public Member Functions

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

Protected Attributes

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

Detailed Description

Class to hook logger output in the local thread.

Definition at line 201 of file core.hpp.

Constructor & Destructor Documentation

◆ LoggerCollectOutput()

LoggerCollectOutput ( bool echo = false)
explicit

Definition at line 118 of file core.cpp.

◆ ~LoggerCollectOutput()

Definition at line 123 of file core.cpp.

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.

◆ clear()

void clear ( )

clear transcript

Definition at line 128 of file core.cpp.

◆ get()

std::string get ( )

return transcript of log

Definition at line 132 of file core.cpp.

Member Data Documentation

◆ echo_

bool echo_
protected

whether to echo each line to next logger output

Definition at line 221 of file core.hpp.

◆ next_

LoggerOutputHook* next_
protected

previous logger, will be restored by destructor

Definition at line 218 of file core.hpp.

◆ oss_

std::ostringstream oss_
protected

string stream collecting

Definition at line 224 of file core.hpp.


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