Commit 6061adb
feat(mdbx): add MdbxLogger
* feat(mdbx): add MdbxLogger
Add MDBX-based logger using mdbx-containers submodule.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* refactor(mdbx): extract detail helpers and privatize types
- Extract detail::MdbxByteIO, detail::MdbxKeyUtils, detail::MdbxProcessId
- Make SessionV1, RecordV1, PayloadV1 private nested types of MdbxLogger
- Add external/kurlyk submodule
- Update read_range/read_session/read_payload to return view types
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* refactor(mdbx): fix compression coupling, add payload decode and error callback
- Move compress/decompress helpers to detail/CompressionUtils.hpp shared by OTLP and MDBX
- OtlpCompression.hpp is now a backward-compat forwarding header
- MdbxLogger no longer depends on otlp/OtlpCompression.hpp
- Add MdbxLogger::read_payload_data() for transparent decompression
- Replace std::cerr with optional Config::on_error callback
- Fix CMake install guard: check mdbx_containers::mdbx_containers target
- Add overflow drop and on_error tests
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* docs(mdbx): add comprehensive MdbxLogger example
- Shows macro logging via LOGIT_* macros
- Reads back session, records, spilled payloads via read_range/read_session/read_payload_data
- Demonstrates date-range query helper (YYYY-MM-DD -> ms)
- Includes level-based client-side filtering and statistics
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* fix(mdbx): remove flaky overflow test and hardcoded date
- Replace flaky test_async_queue_overflow_drop with deterministic
test_counters_zero_for_sync_writes and test_read_range_empty_and_limits
- Compute today midnight in example instead of hardcoded 2026-05-30
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* feat(mdbx): add ILogReader interface, read_recent, and typed logger macros
- Introduce ILogReader.hpp with LogRecordView, LogReadOrder, ILogReader
- MdbxLogger inherits ILogReader; RecordView replaced by shared LogRecordView
- Add read_recent(limit, period_ms, order) returning ascending or descending records
- Add LOGIT_GET_LOGGER_AS and LOGIT_WITH_LOGGER_AS macros in log_macros.hpp
- Example updated to use LOGIT_WITH_LOGGER_AS instead of manual dynamic_cast
- Add read_recent tests and ILogReader usage in mdbx_logger_test.cpp
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* feat(mdbx): add ILogReader interface, read_recent, and typed logger macros
- Introduce ILogReader.hpp with LogRecordView, LogReadOrder, ILogReader
- MdbxLogger inherits ILogReader; RecordView replaced by shared LogRecordView
- Add read_recent(limit, period_ms, order) returning ascending or descending records
- Add LOGIT_GET_LOGGER_AS and LOGIT_WITH_LOGGER_AS macros in log_macros.hpp
- Example updated to use LOGIT_WITH_LOGGER_AS instead of manual dynamic_cast
- Add read_recent tests and ILogReader usage in mdbx_logger_test.cpp
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* refactor(mdbx): move ILogReader to loggers/, deduplicate std headers, add MemoryLogger ILogReader
- Move ILogReader.hpp from logit/ to loggers/ILogReader.hpp (shared backend interface)
- Extract common std headers (atomic, cstddef, cstdint, deque, mutex, string, vector) into loggers.hpp umbrella
- Remove duplicate std includes from MdbxLogger.hpp and MemoryLogger.hpp
- MemoryLogger now inherits ILogReader and implements read_range + read_recent
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* fix(build): add missing <algorithm>, update time-shield-cpp to main
- Add <algorithm> to loggers.hpp umbrella (fixes std::reverse in MemoryLogger)
- Bump time-shield-cpp submodule to main (d3c251b) fixing constexpr floor_mod warnings
- Bump CMake find_package(TimeShield) from 1.0.4 to 1.0.6
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* fix(ilogreader): use relative include for enums.hpp
Change <logit/enums.hpp> to ../enums.hpp so CI with -I../../include resolves correctly
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* fix(mdbx): correct read_recent limit and fix test timestamps
- read_recent now reads full range then takes the last limit records
instead of delegating limit to read_range which returns oldest first
- Test uses LOGIT_CURRENT_TIMESTAMP_MS() as now for period and limit checks
- Add limited_desc assertion to verify Descending with limit
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* feat(macros): add ILogReader query macros
- LOGIT_GET_LOG_READER(index): retrieve ILogReader* from a logger by index
- LOGIT_WITH_LOG_READER(index, var): scoped if-block with ILogReader pointer
- LOGIT_READ_RANGE(index, from_ms, to_ms, limit): read time-window via ILogReader
- LOGIT_READ_RECENT(index, limit, period_ms, order): read recent via ILogReader
- LOGIT_READ_RECENT_ASC / DESC: shortcuts for LogReadOrder::Ascending / Descending
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* feat(mdbx): add live ILogSubscriber callback interface
- Add ILogSubscriber.hpp with add_log_callback / remove_log_callback
- MdbxLogger implements ILogSubscriber; callbacks invoked after commit without locks
- write_item_locked returns Record so write_batch can collect LogRecordView snapshots
- Add LOGIT_GET_LOG_SUBSCRIBER, LOGIT_WITH_LOG_SUBSCRIBER macros
- Add LOGIT_ADD_LOG_CALLBACK, LOGIT_REMOVE_LOG_CALLBACK macros
- Tests: sync callback, async callback, remove stops notifications, exception safety
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* fix(mdbx): move callbacks to public and fix data race in notify_callbacks
- add_log_callback / remove_log_callback now public so direct MdbxLogger calls compile
- notify_callbacks now reads m_callbacks.size() under m_callbacks_mutex
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* docs(mdbx): add live callback subscription to example
- Show add_log_callback, live events via LOGIT_INFO, LOGIT_WAIT
- Show remove_log_callback and verify no further updates
Co-Authored-By: Claude Opus 4.8 <[email protected]>
---------
Co-authored-by: Claude Opus 4.8 <[email protected]>1 parent c69733c commit 6061adb
20 files changed
Lines changed: 2345 additions & 116 deletions
File tree
- cmake
- examples
- external
- include/logit_cpp/logit
- detail
- loggers
- otlp
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
188 | 223 | | |
189 | 224 | | |
190 | 225 | | |
| |||
248 | 283 | | |
249 | 284 | | |
250 | 285 | | |
| 286 | + | |
| 287 | + | |
251 | 288 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
256 | 293 | | |
257 | 294 | | |
258 | 295 | | |
| 296 | + | |
259 | 297 | | |
260 | 298 | | |
261 | 299 | | |
262 | 300 | | |
263 | 301 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 302 | | |
271 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
272 | 318 | | |
273 | 319 | | |
274 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
Submodule mdbx-containers added at fac4001
Submodule time-shield-cpp updated from 23f8715 to d3c251b
0 commit comments