You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,11 @@
1
-
#
1
+
# v1.0.5 - 02-10-2026
2
+
- Add `std::format_args` support: pass a pre-built `std::format_args` object directly to any log call
3
+
- Arguments are unpacked and copied into the log entry on the calling thread (safe across thread boundary)
4
+
- Supports all standard `std::basic_format_arg` types: bool, char, int, unsigned, long long, unsigned long long, float, double, long double, const char*, string_view, and void*
5
+
- Custom formatter types (`std::formatter` handle) are not supported; they will be logged as `<handle>`
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,6 +181,27 @@ int main() {
181
181
-**Extensible**: Easy to add custom formatters for user-defined types
182
182
-**Standard**: Part of C++20 standard library, no external dependencies
183
183
184
+
### Passing std::format_args
185
+
186
+
You can pass a pre-built `std::format_args` object as the single argument to any log call. This lets you capture format arguments once and reuse them, or forward a pre-built arg pack from another function:
187
+
188
+
```cpp
189
+
int count = 42;
190
+
double price = 9.99;
191
+
std::string_view name = "widget";
192
+
193
+
// Capture args once, pass to logger
194
+
auto args = std::make_format_args(count, price, name);
> **Note:** `std::make_format_args` requires all arguments to be lvalues. Pass temporary values via a named variable.
202
+
203
+
> **Limitation:** Custom formatter types (types requiring a `std::formatter` specialization, represented as `handle` inside `std::format_args`) are not supported. They will be logged as `<handle>`. Use the normal variadic log call for custom-formatted types.
0 commit comments