rtop
|
enables indentation of logs for easy viewing More...
#include <rtop_logger.h>
Public Member Functions | |
void | addSpace () |
adds one white-space to white-space string corresponding to invoking thread More... | |
void | delSpace () |
deletes one white-space from white-space string corresponding to invoking thread More... | |
std::string | spacer () |
returns white-space string corresponding to invoking thread More... | |
Private Attributes | |
std::mutex | lgmutex |
std::map< std::thread::id, std::string > | spacers |
Friends | |
std::ostream & | operator<< (std::ostream &ofs, logSpacer &lgSpacer) |
pushes white-space string corresponding to invoking thread to std::ostream More... | |
enables indentation of logs for easy viewing
developer can pass this object to BOOST log stream and it will add appropriate space (corresponing to invoking thread) to the stream. This class has methods for adding/deleting white spaces for each thread.
Note: many member methods are under mutex control as a precaution - mutex use is not backed by solid scenario. Methods do access a common container spacers
, but it is not clear whether any data-races are generated because of that.
Definition at line 118 of file rtop_logger.h.
void logSpacer::addSpace | ( | ) |
adds one white-space to white-space string corresponding to invoking thread
function body is under mutex control.
Definition at line 135 of file rtop_logger.h.
void logSpacer::delSpace | ( | ) |
deletes one white-space from white-space string corresponding to invoking thread
function body is under mutex control
Definition at line 151 of file rtop_logger.h.
std::string logSpacer::spacer | ( | ) |
returns white-space string corresponding to invoking thread
Definition at line 165 of file rtop_logger.h.
|
friend |
pushes white-space string corresponding to invoking thread to std::ostream
function body is under mutex control
Definition at line 179 of file rtop_logger.h.
|
private |
Definition at line 121 of file rtop_logger.h.
|
private |
Definition at line 122 of file rtop_logger.h.