|
QuasarEngine
Cross-platform 3D engine and editor
|
Log sink that keeps the most recent messages in memory, so that the console can display them. More...
#include <quasar/core/MemoryLogSink.h>
Public Member Functions | |
| MemoryLogSink (std::size_t capacity) | |
| Creates a sink that keeps at most capacity messages. A capacity of 0 keeps one message. | |
| std::vector< LogMessage > | GetMessages () const |
| Returns a copy of the kept messages, from the oldest to the most recent. | |
| void | Clear () |
| Removes every kept message. | |
| std::size_t | GetCapacity () const |
| Returns the maximum number of messages the sink keeps. | |
Log sink that keeps the most recent messages in memory, so that the console can display them.
The sink keeps at most a given number of messages: when it is full, each new message replaces the oldest one. Messages can be read from any thread, even while other threads are writing new ones.