Common logging macro
- Dominant language
- Rust
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Unfortunately I'm not good with writing compiler plugins, but seems like we can borrow most of libfmt code. The main problem - it's private...
I see the full syntax something like this:
``` rust
// Simple log without meta and formatting feature. The emitted message is &'static str to avoid unnecessary intermediate formatting.
log!(logger, 0, "le message");
// The emitted message is Arguments<'a>.
log!(logger, 0, "le message: {}, {1}, {name}", 42, 3.1415, name = "Jon Snow");
// With meta information.
log!(logger 0, "le message: {}", 42, {
trace: 100500,
path: "/home",
});
// With meta information, also a meta value is borrowed for formatting.
log!(logger 0, "le message: {}, {path}", 42, {
trace: 100500,
path: "/home",
});
// Which is expanded into:
logger.log(0, Arguments<'a> ["le message: ", &42, ", ", &"/home"], MetaList<'a>(&[Meta::new("trace", &100500), Meta::new("path", "/home")]);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.