![]() |
LogIt++
Header-only, macro-first C++ logging library
|
Optional interface for backends that expose stored records. More...
#include <ILogReader.hpp>
Public Member Functions | |
| virtual | ~ILogReader ()=default |
| virtual std::vector< LogRecordSnapshot > | read_range (int64_t from_ms, int64_t to_ms, std::size_t limit=0) const =0 |
Reads records in [from_ms, to_ms) ordered by timestamp. | |
| virtual std::vector< LogRecordSnapshot > | read_recent (std::size_t limit, int64_t period_ms=0, LogReadOrder order=LogReadOrder::Ascending) const =0 |
| Reads the most recent records. | |
Optional interface for backends that expose stored records.
Implementations should provide read_range for time-window queries and read_recent for "tail -n" style access. Both return owning snapshots so the caller does not depend on backend locking details.
Definition at line 71 of file ILogReader.hpp.
|
virtualdefault |
|
pure virtual |
Reads records in [from_ms, to_ms) ordered by timestamp.
| from_ms | Inclusive start timestamp. |
| to_ms | Exclusive end timestamp. |
| limit | Maximum number of records (0 = unlimited). |
Implemented in logit::MdbxLogger, and logit::MemoryLogger.
|
pure virtual |
Reads the most recent records.
| limit | Maximum number of records (0 = unlimited). |
| period_ms | Time window in milliseconds from now backward (0 = unlimited). |
| order | Ascending (oldest first) or Descending (newest first). |
Implemented in logit::MdbxLogger, and logit::MemoryLogger.