Tweak tracing information

This commit is contained in:
Mihai Dinculescu
2022-10-24 19:28:27 +01:00
parent 1175ab29fb
commit 7186d61467
7 changed files with 253 additions and 167 deletions

View File

@@ -6,6 +6,10 @@ file. This change log follows the conventions of
## [Unreleased] ## [Unreleased]
## Changed
- The tracing information has been adjusted to be at the `info` and `debug` levels instead of `info`.
## [v0.1.2] - 2022-10-22 ## [v0.1.2] - 2022-10-22
### Added ### Added

View File

@@ -13,10 +13,18 @@ cd simconnect-sdk
cargo run --bin data cargo run --bin data
``` ```
## Receiving data using tracing ## Receiving data with tracing
To see all tracing information at the `trace` level and above (most verbose), run:
```bash ```bash
RUST_LOG=info cargo run --bin data_with_tracing RUST_LOG=trace cargo run --bin data_with_tracing
```
To see all tracing information at the `debug` level and above (less verbose than `info`), run:
```bash
RUST_LOG=debug cargo run --bin data_with_tracing
``` ```
## Receiving data without the derive macro ## Receiving data without the derive macro

View File

@@ -22,6 +22,17 @@ struct AirplaneData {
sim_on_ground: bool, sim_on_ground: bool,
} }
/// To see all tracing information at the `trace` level and above (most verbose), run:
///
/// ```bash
/// RUST_LOG=trace cargo run --bin data_with_tracing
/// ```
///
/// To see all tracing information at the `debug` level and above (less verbose than `info`), run:
///
/// ```bash
/// RUST_LOG=debug cargo run --bin data_with_tracing
/// ```
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
setup_logging()?; setup_logging()?;

View File

@@ -1,5 +1,7 @@
use std::{collections::HashMap, ffi::c_void}; use std::{collections::HashMap, ffi::c_void};
use tracing::{error, span, trace, warn, Level};
use crate::{ use crate::{
as_c_string, bindings, helpers::fixed_c_str_to_string, ok_if_fail, success, Airport, Event, as_c_string, bindings, helpers::fixed_c_str_to_string, ok_if_fail, success, Airport, Event,
Notification, Object, SimConnectError, Waypoint, NDB, VOR, Notification, Object, SimConnectError, Waypoint, NDB, VOR,
@@ -87,7 +89,7 @@ pub struct SimConnect {
impl SimConnect { impl SimConnect {
/// Create a new SimConnect SDK client. /// Create a new SimConnect SDK client.
#[tracing::instrument(name = "SimConnect::new")] #[tracing::instrument(name = "SimConnect::new", level = "debug")]
pub fn new(name: &str) -> Result<Self, SimConnectError> { pub fn new(name: &str) -> Result<Self, SimConnectError> {
let mut handle = std::ptr::null_mut(); let mut handle = std::ptr::null_mut();
@@ -136,180 +138,212 @@ impl SimConnect {
let recv_id = unsafe { (*data_buf).dwID as i32 }; let recv_id = unsafe { (*data_buf).dwID as i32 };
let result = match recv_id { if recv_id == bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_NULL {
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_OPEN => Some(Notification::Open), Ok(None)
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_QUIT => Some(Notification::Quit), } else {
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_EVENT => { let span = span!(Level::TRACE, "SimConnect::get_next_dispatch");
let event: &bindings::SIMCONNECT_RECV_EVENT = let _enter = span.enter();
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_EVENT) };
let event = Event::try_from(event.uEventID) let result = match recv_id {
.map_err(|_| SimConnectError::SimConnectUnrecognizedEvent(event.uEventID))?; bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_OPEN => {
trace!("Received SIMCONNECT_RECV_OPEN");
Some(Notification::Event(event)) Some(Notification::Open)
}
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_SIMOBJECT_DATA => {
let event: &bindings::SIMCONNECT_RECV_SIMOBJECT_DATA =
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_SIMOBJECT_DATA) };
let type_name = self.get_type_name_by_request_id(event.dwDefineID);
match type_name {
Some(type_name) => {
let data = Object {
type_name,
data_addr: std::ptr::addr_of!(event.dwData),
};
Some(Notification::Object(data))
}
_ => None,
} }
} bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_QUIT => {
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_AIRPORT_LIST => { trace!("Received SIMCONNECT_RECV_QUIT");
let event: &bindings::SIMCONNECT_RECV_AIRPORT_LIST = Some(Notification::Quit)
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_AIRPORT_LIST) }; }
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_EVENT => {
trace!("Received SIMCONNECT_RECV_EVENT");
let event: &bindings::SIMCONNECT_RECV_EVENT =
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_EVENT) };
let data = (0..event._base.dwArraySize as usize) let event = Event::try_from(event.uEventID).map_err(|_| {
.map(|i| { SimConnectError::SimConnectUnimplementedEvent(event.uEventID)
// `rgData` is defined as a 1-element array, but it is actually a variable-length array. })?;
let record = unsafe { event.rgData.get_unchecked(i) };
Airport { Some(Notification::Event(event))
icao: fixed_c_str_to_string(&record.Icao), }
lat: record.Latitude, bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_SIMOBJECT_DATA => {
lon: record.Longitude, trace!("Received SIMCONNECT_RECV_SIMOBJECT_DATA");
alt: record.Altitude,
let event: &bindings::SIMCONNECT_RECV_SIMOBJECT_DATA =
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_SIMOBJECT_DATA) };
let type_name = self.get_type_name_by_request_id(event.dwDefineID);
match type_name {
Some(type_name) => {
let data = Object {
type_name,
data_addr: std::ptr::addr_of!(event.dwData),
};
Some(Notification::Object(data))
} }
}) _ => None,
.collect::<Vec<_>>(); }
}
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_AIRPORT_LIST => {
trace!("Received SIMCONNECT_RECV_AIRPORT_LIST");
Some(Notification::AirportList(data)) let event: &bindings::SIMCONNECT_RECV_AIRPORT_LIST =
} unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_AIRPORT_LIST) };
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_WAYPOINT_LIST => {
let event: &bindings::SIMCONNECT_RECV_WAYPOINT_LIST =
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_WAYPOINT_LIST) };
let data = (0..event._base.dwArraySize as usize) let data = (0..event._base.dwArraySize as usize)
.map(|i| { .map(|i| {
// `rgData` is defined as a 1-element array, but it is actually a variable-length array. // `rgData` is defined as a 1-element array, but it is actually a variable-length array.
let record = unsafe { event.rgData.get_unchecked(i) }; let record = unsafe { event.rgData.get_unchecked(i) };
Waypoint { Airport {
icao: fixed_c_str_to_string(&record._base.Icao), icao: fixed_c_str_to_string(&record.Icao),
lat: record._base.Latitude, lat: record.Latitude,
lon: record._base.Longitude, lon: record.Longitude,
alt: record._base.Altitude, alt: record.Altitude,
mag_var: record.fMagVar, }
} })
}) .collect::<Vec<_>>();
.collect::<Vec<_>>();
Some(Notification::WaypointList(data)) Some(Notification::AirportList(data))
} }
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_NDB_LIST => { bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_WAYPOINT_LIST => {
let event: &bindings::SIMCONNECT_RECV_NDB_LIST = trace!("Received SIMCONNECT_RECV_WAYPOINT_LIST");
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_NDB_LIST) };
let data = (0..event._base.dwArraySize as usize) let event: &bindings::SIMCONNECT_RECV_WAYPOINT_LIST =
.map(|i| { unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_WAYPOINT_LIST) };
// `rgData` is defined as a 1-element array, but it is actually a variable-length array.
let record = unsafe { event.rgData.get_unchecked(i) };
NDB { let data = (0..event._base.dwArraySize as usize)
icao: fixed_c_str_to_string(&record._base._base.Icao), .map(|i| {
lat: record._base._base.Latitude, // `rgData` is defined as a 1-element array, but it is actually a variable-length array.
lon: record._base._base.Longitude, let record = unsafe { event.rgData.get_unchecked(i) };
alt: record._base._base.Altitude,
mag_var: record._base.fMagVar,
frequency: record.fFrequency,
}
})
.collect::<Vec<_>>();
Some(Notification::NdbList(data)) Waypoint {
} icao: fixed_c_str_to_string(&record._base.Icao),
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_VOR_LIST => { lat: record._base.Latitude,
let event: &bindings::SIMCONNECT_RECV_VOR_LIST = lon: record._base.Longitude,
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_VOR_LIST) }; alt: record._base.Altitude,
mag_var: record.fMagVar,
}
})
.collect::<Vec<_>>();
let data = (0..event._base.dwArraySize as usize) Some(Notification::WaypointList(data))
.map(|i| { }
// `rgData` is defined as a 1-element array, but it is actually a variable-length array. bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_NDB_LIST => {
let record = unsafe { event.rgData.get_unchecked(i) }; trace!("Received SIMCONNECT_RECV_NDB_LIST");
let has_nav_signal = record.Flags let event: &bindings::SIMCONNECT_RECV_NDB_LIST =
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_NDB_LIST) };
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL;
let has_localizer = record.Flags
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER;
let has_glide_slope = record.Flags
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE;
let has_dme = record.Flags & bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME;
VOR { let data = (0..event._base.dwArraySize as usize)
icao: fixed_c_str_to_string(&record._base._base._base.Icao), .map(|i| {
lat: record._base._base._base.Latitude, // `rgData` is defined as a 1-element array, but it is actually a variable-length array.
lon: record._base._base._base.Longitude, let record = unsafe { event.rgData.get_unchecked(i) };
alt: record._base._base._base.Altitude,
mag_var: record._base._base.fMagVar,
has_nav_signal,
has_localizer,
has_glide_slope,
has_dme,
localizer: if has_localizer {
Some(record.fLocalizer)
} else {
None
},
glide_lat: if has_nav_signal {
Some(record.GlideLat)
} else {
None
},
glide_lon: if has_nav_signal {
Some(record.GlideLon)
} else {
None
},
glide_alt: if has_nav_signal {
Some(record.GlideAlt)
} else {
None
},
glide_slope_angle: if has_glide_slope {
Some(record.fGlideSlopeAngle)
} else {
None
},
frequency: if has_dme {
Some(record._base.fFrequency)
} else {
None
},
}
})
.collect::<Vec<_>>();
Some(Notification::VorList(data)) NDB {
} icao: fixed_c_str_to_string(&record._base._base.Icao),
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_EXCEPTION => { lat: record._base._base.Latitude,
let event: &bindings::SIMCONNECT_RECV_EXCEPTION = lon: record._base._base.Longitude,
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_EXCEPTION) }; alt: record._base._base.Altitude,
Some(Notification::Exception(event.dwException)) mag_var: record._base.fMagVar,
} frequency: record.fFrequency,
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_NULL => None, }
id => panic!("Got unrecognized notification: {id}"), })
}; .collect::<Vec<_>>();
Ok(result) Some(Notification::NdbList(data))
}
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_VOR_LIST => {
trace!("Received SIMCONNECT_RECV_VOR_LIST");
let event: &bindings::SIMCONNECT_RECV_VOR_LIST =
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_VOR_LIST) };
let data = (0..event._base.dwArraySize as usize)
.map(|i| {
// `rgData` is defined as a 1-element array, but it is actually a variable-length array.
let record = unsafe { event.rgData.get_unchecked(i) };
let has_nav_signal = record.Flags
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_NAV_SIGNAL;
let has_localizer = record.Flags
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_LOCALIZER;
let has_glide_slope = record.Flags
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_GLIDE_SLOPE;
let has_dme = record.Flags
& bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME;
VOR {
icao: fixed_c_str_to_string(&record._base._base._base.Icao),
lat: record._base._base._base.Latitude,
lon: record._base._base._base.Longitude,
alt: record._base._base._base.Altitude,
mag_var: record._base._base.fMagVar,
has_nav_signal,
has_localizer,
has_glide_slope,
has_dme,
localizer: if has_localizer {
Some(record.fLocalizer)
} else {
None
},
glide_lat: if has_nav_signal {
Some(record.GlideLat)
} else {
None
},
glide_lon: if has_nav_signal {
Some(record.GlideLon)
} else {
None
},
glide_alt: if has_nav_signal {
Some(record.GlideAlt)
} else {
None
},
glide_slope_angle: if has_glide_slope {
Some(record.fGlideSlopeAngle)
} else {
None
},
frequency: if has_dme {
Some(record._base.fFrequency)
} else {
None
},
}
})
.collect::<Vec<_>>();
Some(Notification::VorList(data))
}
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_EXCEPTION => {
let event: &bindings::SIMCONNECT_RECV_EXCEPTION =
unsafe { &*(data_buf as *const bindings::SIMCONNECT_RECV_EXCEPTION) };
warn!("Received {:?}", event);
Some(Notification::Exception(event.dwException))
}
bindings::SIMCONNECT_RECV_ID_SIMCONNECT_RECV_ID_NULL => None,
id => {
error!("Received unhandled notification ID: {}", id);
panic!("Got unrecognized notification: {id}");
}
};
Ok(result)
}
} }
/// Register a Request ID in the internal state so that the user doesn't have to manually manage Request IDs. /// Register a Request ID in the internal state so that the user doesn't have to manually manage Request IDs.
#[tracing::instrument(name = "SimConnect::new_request_id")] #[tracing::instrument(name = "SimConnect::new_request_id", level = "trace", skip(self))]
pub(super) fn new_request_id(&mut self, type_name: String) -> Result<u32, SimConnectError> { pub(super) fn new_request_id(&mut self, type_name: String) -> Result<u32, SimConnectError> {
if self.registered_objects.contains_key(&type_name) { if self.registered_objects.contains_key(&type_name) {
return Err(SimConnectError::ObjectAlreadyRegistered(type_name)); return Err(SimConnectError::ObjectAlreadyRegistered(type_name));
@@ -331,13 +365,21 @@ impl SimConnect {
} }
/// Unregister a Request ID in the internal state so that the user doesn't have to manually manage Request IDs. /// Unregister a Request ID in the internal state so that the user doesn't have to manually manage Request IDs.
#[tracing::instrument(name = "SimConnect::unregister_request_id_by_type_name")] #[tracing::instrument(
name = "SimConnect::unregister_request_id_by_type_name",
level = "trace",
skip(self)
)]
pub(super) fn unregister_request_id_by_type_name(&mut self, type_name: &str) -> Option<u32> { pub(super) fn unregister_request_id_by_type_name(&mut self, type_name: &str) -> Option<u32> {
self.registered_objects.remove(type_name) self.registered_objects.remove(type_name)
} }
/// Get the Type Name of a Request ID. /// Get the Type Name of a Request ID.
#[tracing::instrument(name = "SimConnect::get_type_name_by_request_id")] #[tracing::instrument(
name = "SimConnect::get_type_name_by_request_id",
level = "trace",
skip(self)
)]
pub(super) fn get_type_name_by_request_id(&self, request_id: u32) -> Option<String> { pub(super) fn get_type_name_by_request_id(&self, request_id: u32) -> Option<String> {
self.registered_objects self.registered_objects
.iter() .iter()
@@ -347,6 +389,7 @@ impl SimConnect {
} }
impl Drop for SimConnect { impl Drop for SimConnect {
#[tracing::instrument(name = "SimConnect::drop", level = "debug", skip(self))]
fn drop(&mut self) { fn drop(&mut self) {
let _ = unsafe { bindings::SimConnect_Close(self.handle.as_ptr()) }; let _ = unsafe { bindings::SimConnect_Close(self.handle.as_ptr()) };
} }

View File

@@ -4,7 +4,7 @@ impl SimConnect {
/// Associates a client defined event with a Microsoft Flight Simulator event name. /// Associates a client defined event with a Microsoft Flight Simulator event name.
/// ///
/// WIP /// WIP
#[tracing::instrument(name = "SimConnect::register_event")] #[tracing::instrument(name = "SimConnect::register_event", level = "debug", skip(self))]
pub fn register_event( pub fn register_event(
&self, &self,
event: Event, event: Event,

View File

@@ -10,7 +10,11 @@ impl SimConnect {
/// The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft. /// The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft.
/// This radius varies depending on where the aircraft is in the world, but is at least large enough to encompass the whole of the reality bubble for airports and waypoints, and can be over 200 miles for VOR and NDB stations. /// This radius varies depending on where the aircraft is in the world, but is at least large enough to encompass the whole of the reality bubble for airports and waypoints, and can be over 200 miles for VOR and NDB stations.
/// As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system. /// As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system.
#[tracing::instrument(name = "SimConnect::request_facilities_list")] #[tracing::instrument(
name = "SimConnect::request_facilities_list",
level = "debug",
skip(self)
)]
pub fn request_facilities_list( pub fn request_facilities_list(
&mut self, &mut self,
facility_type: FacilityType, facility_type: FacilityType,
@@ -42,7 +46,11 @@ impl SimConnect {
/// The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft. /// The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft.
/// This radius varies depending on where the aircraft is in the world, but is at least large enough to encompass the whole of the reality bubble for airports and waypoints, and can be over 200 miles for VOR and NDB stations. /// This radius varies depending on where the aircraft is in the world, but is at least large enough to encompass the whole of the reality bubble for airports and waypoints, and can be over 200 miles for VOR and NDB stations.
/// As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system. /// As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system.
#[tracing::instrument(name = "SimConnect::subscribe_to_facilities")] #[tracing::instrument(
name = "SimConnect::subscribe_to_facilities",
level = "debug",
skip(self)
)]
pub fn subscribe_to_facilities( pub fn subscribe_to_facilities(
&mut self, &mut self,
facility_type: FacilityType, facility_type: FacilityType,
@@ -65,7 +73,11 @@ impl SimConnect {
/// ///
/// # Remarks /// # Remarks
/// This is used to terminate notifications generated by the [`crate::SimConnect::request_facilities_list`] or [`crate::SimConnect::subscribe_to_facilities`] functions. /// This is used to terminate notifications generated by the [`crate::SimConnect::request_facilities_list`] or [`crate::SimConnect::subscribe_to_facilities`] functions.
#[tracing::instrument(name = "SimConnect::unsubscribe_to_facilities")] #[tracing::instrument(
name = "SimConnect::unsubscribe_to_facilities",
level = "debug",
skip(self)
)]
pub fn unsubscribe_to_facilities( pub fn unsubscribe_to_facilities(
&mut self, &mut self,
facility_type: FacilityType, facility_type: FacilityType,

View File

@@ -5,7 +5,7 @@ use crate::{
impl SimConnect { impl SimConnect {
// Register an object with SimConnect by assigning it an unique interval `request_id` and then calling the [`crate::SimConnectObjectExt::register`] method on the struct. // Register an object with SimConnect by assigning it an unique interval `request_id` and then calling the [`crate::SimConnectObjectExt::register`] method on the struct.
#[tracing::instrument(name = "SimConnect::register_object")] #[tracing::instrument(name = "SimConnect::register_object", level = "debug", skip(self))]
pub fn register_object<T: SimConnectObjectExt>(&mut self) -> Result<u32, SimConnectError> { pub fn register_object<T: SimConnectObjectExt>(&mut self) -> Result<u32, SimConnectError> {
let type_name: String = std::any::type_name::<T>().into(); let type_name: String = std::any::type_name::<T>().into();
@@ -17,7 +17,7 @@ impl SimConnect {
} }
// Unregister an object with SimConnect. // Unregister an object with SimConnect.
#[tracing::instrument(name = "SimConnect::unregister_object")] #[tracing::instrument(name = "SimConnect::unregister_object", level = "debug", skip(self))]
pub fn unregister_object<T: SimConnectObjectExt>(&mut self) -> Result<u32, SimConnectError> { pub fn unregister_object<T: SimConnectObjectExt>(&mut self) -> Result<u32, SimConnectError> {
let type_name: String = std::any::type_name::<T>().into(); let type_name: String = std::any::type_name::<T>().into();
@@ -41,7 +41,11 @@ impl SimConnect {
/// ///
/// # Remarks /// # Remarks
/// The [`crate::SimConnectObject`] macro will automatically call this method for the struct. /// The [`crate::SimConnectObject`] macro will automatically call this method for the struct.
#[tracing::instrument(name = "SimConnect::add_to_data_definition")] #[tracing::instrument(
name = "SimConnect::add_to_data_definition",
level = "debug",
skip(self)
)]
pub fn add_to_data_definition( pub fn add_to_data_definition(
&self, &self,
request_id: u32, request_id: u32,
@@ -84,7 +88,11 @@ impl SimConnect {
/// ///
/// # Remarks /// # Remarks
/// The [`crate::SimConnectObject`] macro will automatically call this method for the struct. /// The [`crate::SimConnectObject`] macro will automatically call this method for the struct.
#[tracing::instrument(name = "SimConnect::request_data_on_sim_object")] #[tracing::instrument(
name = "SimConnect::request_data_on_sim_object",
level = "debug",
skip(self)
)]
pub fn request_data_on_sim_object( pub fn request_data_on_sim_object(
&self, &self,
request_id: u32, request_id: u32,