-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log: Support structured values #341
Comments
OT: @hawkw I've just created this issue and self-assigned it to signal that I'm working on sketching out some more details, but if you have a particular way you like to organize things here let me know and I'll follow that :) |
@KodrAus thanks, this is great! I've wanted to open a ticket for discussing this work for a while.
I'm definitely willing to make changes to |
#2048 is related, since it makes more things able to be dynamically imported. The biggest hurdle AIUI for ingesting log's kvs into tracing is that tracing requires static enum FieldImpl {
Static { fields: &'static [&'static str], index: usize, callsite: &'static dyn Callsite }
Dynamic { name: &str, callsite: &dyn Callsite } // niches, via nullptr in Static.fields
} This is necessarily a breaking change to handle non- |
Hello! Been looking forward to integrate rust-lang/log with tracing in our new project. Started digging into the problems of why converting What digging exactly? Tried to do it myself 😢 Then stumbled upon this issue and #2048 PR. Would this feature be implemented into tracing-log? Or is there any other solution available? Unfortunately, |
Feature Request
Crates
tracing-log
Motivation
Large applications may use libraries or components that use a combination of the
log
crate andtracing
. We can support better diagnostics in these applications by making the most of the shared feature-set betweenlog
andtracing
. That means retaining as much structure as possible when pushing diagnostic data between them.In rust-lang/log#328 we're tracking the progress of structured logging support in the
log
crate. One of its stabilization blockers is that it works nicely withtracing
.Proposal
This is a bit of an open question, we've got flexibility on the
log
side to tweak things as needed for better integration withtracing
. Sincetracing
already makes some concessions tolog
support (by handling it explicitly in its event macros) I'm guessing we've got a little flexibility on thetracing
side too.I'm proposing we aim for zero-cost structured integration between
log
andtracing
by leveraging the existing hook in the event macros and using thelog::kv
APIs to translate between them.The text was updated successfully, but these errors were encountered: