tracing
tracing copied to clipboard
attributes: allow expression span names
Motivation
Being able to use a static str reference rather than a string literal is helpful for certain deployments.
Solution
Parse the name argument of the instrument macro as an expression, not just a string literal.
Ping @hawkw @davidbarsky, is this a change you would be open to?
I think we'll need to get some input from @hawkw on this one before we move further.
I'm somewhat surprised this works; I thought tracing's macros that instrument expands to required a literal and not a static reference. But, if this actually generates code that compiles, I'm happy to merge it.
@bryangarza apologies about the delay, I've rebased this and #1705.
~I have to say I'm a bit confused about the CI failure, it's complaining about a test that looks to my eyes just the same as the test above, and I can't reproduce the build failure locally.~ (edit: nevermind, found it)
No worries, thanks for getting back to it!