Replies: 1 comment 3 replies
-
I believe that what you are describing (with the variable) is not possible, because the field names have to be static data (to minimize the number of allocations). Using a constant could potentially work if somewhere were to update the tracing macros to support it. Q: Or some workaround that I could do myself to kinda-sorta pretend that feature exists via my own macro(s) or something? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to have dynamic fields? Something like:
and have it output something with the
cloud.account.id
field and value234
?Even if it weren't technically "dynamic", but at least in some sort of constant, that'd be fine for me:
I tried making my own type and implementing
AsField
, which looked like it should have worked...but
AsField
is a sealed trait 😭 , so I can't implement it outsidetracing
itself AFAICT.If the answer is "No, there's no way to do that." Then my followup questions would be
tracing::info!($cloud_account_id = 234, "created the cloud account id");
Beta Was this translation helpful? Give feedback.
All reactions