Story: Logging refactor (std::string_view)
Table of Contents
This page documents a story in Sprint 06. It captures the goal, current status, acceptance criteria, and the tasks that compose it.
Goal
Move the logging API to std::string_view for performance — and
clean up the regressions and Valgrind leaks the change introduced.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent sprint | Sprint 06 |
| Now | Completed 2025-12-12. |
| Waiting on | None. |
| Next | None. |
| Last touched | 2025-12-12 |
Acceptance
- Logger API takes
std::string_viewrather thanstd::string. - Call sites build and tests pass.
- Valgrind clean on logging-heavy tests.
Tasks
| Task | State | Start | End | Description |
|---|---|---|---|---|
| Use std::string_view for loggers | DONE | 2025-12-12 | 2025-12-12 | Take std::string_view rather than std::string in the logging API so call sites avoid an allocation per log line. |
| Fix issues with logging after string_view change | DONE | 2025-12-12 | 2025-12-12 | Repair call sites and tests that broke under the string_view migration. |
| Fix valgrind leaks after string view changes to logging | DONE | 2025-12-12 | 2025-12-12 | The string_view change introduced dangling-view leaks at log emission; fix the lifetime issues. |
Decisions
- Document the dangling-view trap
std::string_viewover a temporary is a recurring footgun. Captured in the logging knowledge note so future contributors don't relearn the lesson.
Out of scope
- Switching logging backends.
See also
- ores.logging — the logging component.
- Logging and observability (sprint 03) — predecessor story that established the Boost.Log idioms this builds on.