ZeroErr
|
LogIterator is a class to iterate the log messages. More...
#include <log.h>
Public Member Functions | |
LogIterator () | |
LogIterator (LogStream &stream, std::string message="", std::string function_name="", int line=-1) | |
LogIterator (const LogIterator &rhs) | |
LogIterator & | operator= (const LogIterator &rhs) |
LogIterator & | operator++ () |
LogIterator | operator++ (int) |
template<typename T > | |
T | get (std::string name) |
bool | operator== (const LogIterator &rhs) const |
bool | operator!= (const LogIterator &rhs) const |
LogMessage & | get () const |
LogMessage & | operator* () const |
LogMessage * | operator-> () const |
void | check_at_safe_pos () |
Protected Member Functions | |
bool | check_filter () |
void | next () |
Protected Attributes | |
DataBlock * | p |
LogMessage * | q |
std::string | function_name_filter |
std::string | message_filter |
int | line_filter = -1 |
Friends | |
class | LogStream |
LogIterator is a class to iterate the log messages.
LogIterator is a class to iterate the log messages. You can also filter the log messages by message, function name, and line number.
An example of using LogIterator: for (int i = 0; i < 10; ++i) log("i = {i}", i);
LogIterator it = LogStream::getDefault().begin("Hello, world!"); LogIterator end = LogStream::getDefault().end();
for (; it != end; ++it) { LogMessage& msg = *it; std::cout << msg.str() << std::endl; // "i = {i}" std::cout << it.get<int>("i") << std::endl; // "0", "1", "2", ... }
|
inline |
zeroerr::LogIterator::LogIterator | ( | LogStream & | stream, |
std::string | message = "" , |
||
std::string | function_name = "" , |
||
int | line = -1 |
||
) |
|
inline |
void zeroerr::LogIterator::check_at_safe_pos | ( | ) |
|
protected |
|
inline |
|
inline |
|
protected |
|
inline |
|
inline |
LogIterator & zeroerr::LogIterator::operator++ | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |