Implement FLOGF formatting

Note: This *requires* an argument after the format string:

```rust
FLOGF!(debug, "foo");
```

won't compile. I think that's okay, because in that case you should
just use FLOG.

An alternative is to make it skip the sprintf.
This commit is contained in:
Fabian Boehm 2023-08-19 11:28:48 +02:00
parent 798d7427f7
commit 53a5ce52c5

View File

@ -191,10 +191,9 @@ macro_rules! FLOG {
};
}
// TODO implement.
macro_rules! FLOGF {
($category:ident, $($elem:expr),+ $(,)*) => {
crate::flog::FLOG!($category, $($elem),*);
($category:ident, $fmt: expr, $($elem:expr),+ $(,)*) => {
crate::flog::FLOG!($category, sprintf!($fmt, $($elem),*));
}
}