|
StreamLog 1.0.0
A lightweight C++11 logging library with stream-based API
|
RAII wrapper for building and committing log messages. More...
#include <streamlog.hpp>
Public Member Functions | |
| LogStatement (LogStatement &&other) noexcept | |
| Move constructor. | |
| LogStatement (StreamLog &logger) | |
| Construct LogStatement bound to a logger. | |
| template<typename T> | |
| LogStatement & | operator<< (const T &value) |
| Stream insertion operator for generic types. | |
| LogStatement & | operator<< (const char *value) |
| Stream insertion operator for C-strings. | |
| void | clearBuffer () |
| Clear the internal message buffer. | |
| std::string | getBufferContent () const |
| Get current buffer contents. | |
| void | appendToBuffer (const std::string &content) |
| Append content to buffer. | |
| ~LogStatement () | |
| Destructor commits the log message. | |
RAII wrapper for building and committing log messages.
LogStatement accumulates message fragments via operator<< and commits the complete message when destroyed. Supports streaming of built-in types, strings, and optionally STL containers.
|
noexcept |
Move constructor.
| other | Source LogStatement to move from |
| StreamLog::LogStatement::LogStatement | ( | StreamLog & | logger | ) |
Construct LogStatement bound to a logger.
| logger | Reference to parent StreamLog instance |
| StreamLog::LogStatement::~LogStatement | ( | ) |
Destructor commits the log message.
RAII pattern: message is written to file/console when LogStatement goes out of scope.
| void StreamLog::LogStatement::appendToBuffer | ( | const std::string & | content | ) |
Append content to buffer.
| content | String to append |
| void StreamLog::LogStatement::clearBuffer | ( | ) |
Clear the internal message buffer.
| std::string StreamLog::LogStatement::getBufferContent | ( | ) | const |
Get current buffer contents.
|
inline |
Stream insertion operator for C-strings.
| value | C-string to append |
|
inline |
Stream insertion operator for generic types.
| T | Type supporting operator<< to std::ostream |
| value | Value to append to log message |