Keeps the latest messages in memory, to replay them into another sink later.
More...
#include <RST/log/Sinks/RingBufferSink.hpp>
|
| void | log (const LogMessage &message) override |
| | Writes one message; called with the sink mutex locked.
|
| |
| virtual void | flushSink () |
| | Flushes the output; called with the sink mutex locked.
|
| |
| std::string_view | formatted (const LogMessage &message) |
| | The message formatted with the sink pattern.
|
| |
| std::mutex & | sinkMutex () noexcept |
| |
Keeps the latest messages in memory, to replay them into another sink later.
◆ RingBufferSink()
| RST::Log::RingBufferSink::RingBufferSink |
( |
std::size_t |
maxMessages, |
|
|
std::size_t |
maxBytes = DEFAULT_MAX_BYTES |
|
) |
| |
|
explicit |
Keeps up to maxMessages messages and about maxBytes bytes, dropping the oldest first.
◆ replayInto()
| void RST::Log::RingBufferSink::replayInto |
( |
ISink & |
sink | ) |
|
Writes the kept messages into sink, oldest first.
◆ snapshot()
Copies of the kept messages, oldest first.
◆ size()
| std::size_t RST::Log::RingBufferSink::size |
( |
| ) |
|
◆ log()
| void RST::Log::RingBufferSink::log |
( |
const LogMessage & |
message | ) |
|
|
overrideprotectedvirtual |
Writes one message; called with the sink mutex locked.
Implements RST::Log::ASink.
◆ DEFAULT_MAX_BYTES
| constexpr std::size_t RST::Log::RingBufferSink::DEFAULT_MAX_BYTES = 1024 * 1024 |
|
staticconstexpr |
The documentation for this class was generated from the following file: