Allow telemetry::event! with no properties (#22190)

CC @josephTLyons

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-12-18 09:41:47 -07:00 committed by GitHub
parent 433cb99170
commit 77abf13f42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 78 deletions

View file

@ -17,6 +17,13 @@ pub use telemetry_events::FlexibleEvent as Event;
/// ```
#[macro_export]
macro_rules! event {
($name:expr) => {{
let event = $crate::Event {
event_type: $name.to_string(),
event_properties: std::collections::HashMap::new(),
};
$crate::send_event(event);
}};
($name:expr, $($key:ident $(= $value:expr)?),+ $(,)?) => {{
let event = $crate::Event {
event_type: $name.to_string(),