Open hawkw opened 5 years ago
I think this would be great! I've noticed that using sections either end up with a listing of most of the common macros or they churn frequently as usage changes.
I agree with your third bullet point - the display/debug sigils probably make field
unnecessary in the prelude.
My one concern is that event
seems like it could be a common identifier. Is the event!
macro used commonly enough that it should be included in the prelude? I would like to include it for the sake of uniformity, but perhaps there's an argument for leaving it out.
I've implemented this in https://github.com/tokio-rs/tracing/pull/719
Feature Request
Crates
tracing
Motivation
It might be useful for the
tracing
crate to expose a prelude containing commonly used types, traits, functions, macros, etc.Proposal
We should add a prelude module to
tracing
. It should probably be fairly conservative, but should re-export at least the following:span!
,event!
, and theirlevel!
/level_span!
equivalentsLevel
typefield
module, to allow the use offield::debug
andfield::display
, although this is obviated somewhat bu the existence of the display/debug shorthand sigils IMO?I don't think there are currently any traits that need to be in scope to use
tracing
. If it eventually becomes necessary to add traits to the prelude, we should probably rename them with a prefix, to ensure they don't conflict with other imports of similarly named traits.