Add user-friendly macros to support optional properties, tags
Opened this issue · 1 comments
ranweiler commented
As a user, I'd love a log
/tracing
-style mechanism where I can opt into initializing and registering a global client, and then using macros to simulate variadic calls that let me insert custom tags and properties.
In practice, this could look like:
appinsights::track_event!("my custom event"; k1 = "v1", k2 = ?v2, k3 = %v3);
In this example, the event name would be custom event
, k1
would map to the string v1
, k2
would map to the Debug
impl for the value of v2
, and k3
would map to the Display
impl for the value of v3
. This could (ideally) be supported in all event types.
dmolokanov commented
Totally agree. Adding changes for public API of the crate is in my TODO list as a next step. First thing I wanted to get feature parity with go client. Ergonomics should also be a priority.