chore(vendor): update vendored libenderlog to v0.0.3
Dated record timestamps, per-sink timestamp format, and archive names that keep the extension last (<stem>.<timestamp>.<ext>).
This commit is contained in:
Vendored
+13
-6
@@ -23,8 +23,8 @@ engine, not on a logging framework.
|
||||
(for tests and in-game consoles) ship; `sink` is a small interface.
|
||||
- **File output with archiving.** `file_sink` writes to a file and, on open,
|
||||
moves an existing log aside to a timestamped archive, so a run never appends
|
||||
onto a previous run's log. It can also rotate by size and bound how many
|
||||
archives are kept.
|
||||
onto a previous run's log. It can also rotate by size, bound how many archives
|
||||
are kept, and format both the record timestamp and the archive names.
|
||||
- **No stacktrace? No problem.** Where `<stacktrace>` is missing (libc++, and
|
||||
therefore every cross target), the module still compiles and records still
|
||||
carry their call site — they simply have no stack.
|
||||
@@ -104,7 +104,7 @@ auto main() -> int {
|
||||
Example output:
|
||||
|
||||
```
|
||||
[11:32:18] ERROR example: a body left the world (examples/main.cpp:8)
|
||||
[2026-10-01 11:32:18] ERROR example: a body left the world (examples/main.cpp:8)
|
||||
#0 simulate_one_step (examples/main.cpp:8)
|
||||
#1 main (examples/main.cpp:20)
|
||||
#2 <unknown>
|
||||
@@ -137,14 +137,21 @@ auto sink = log::add_file_sink("enderlog.log", {.max_file_size = 64 * 1024, .max
|
||||
```
|
||||
|
||||
- **No appending onto a previous run.** On open, an existing non-empty
|
||||
`enderlog.log` is renamed to `enderlog.<YYYYmmdd-HHMMSS>.log` before the new
|
||||
file is created, so every run gets its own file and the previous run's log is
|
||||
preserved. A leftover empty file is simply replaced.
|
||||
`enderlog.log` is renamed to `enderlog.<timestamp>.log` before the new file is
|
||||
created, so every run gets its own file and the previous run's log is
|
||||
preserved. The timestamp is inserted before the extension, which stays last
|
||||
(`.log` when the active file has none). A leftover empty file is simply
|
||||
replaced.
|
||||
- `file_options::max_file_size` (0 disables) rotates the active file mid-run the
|
||||
same way, and never archives an empty file. `file_options::max_archives`
|
||||
(0 keeps all) deletes the oldest archives beyond the limit.
|
||||
- `file_options::flush_each_record` (on by default) flushes after every record so
|
||||
a crash keeps the tail.
|
||||
- `file_options::timestamp_format` (chrono syntax, default `%Y-%m-%d %H:%M:%S`)
|
||||
controls the timestamp on each record's header line;
|
||||
`file_options::archive_time_format` (chrono syntax, default `%Y%m%d-%H%M%S`)
|
||||
controls the timestamp inserted into archive names. A chrono format string must
|
||||
begin with `%` (e.g. `%Y-%m-%d_%H%M%S`).
|
||||
- `add_file_sink` adds the sink to the global logger and returns it; `path()` and
|
||||
`archives()` expose what it wrote. The `file_sink` class can also be used
|
||||
directly and installed with `set_sinks`.
|
||||
|
||||
Reference in New Issue
Block a user