Skip to content

Commit

Permalink
fix(winloc): add additional trace logging to the location handler
Browse files Browse the repository at this point in the history
  • Loading branch information
spmadden committed Sep 18, 2023
1 parent 4493c8e commit 01adbbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion interfaces/win-location-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub use crate::windows::*;

#[cfg(target_os = "windows")]
mod windows {
use log::{error, trace, warn};
use log::{error, info, trace, warn};
use windows::Devices::Geolocation::{Geolocator, PositionChangedEventArgs};
use windows::Foundation::{EventRegistrationToken, TypedEventHandler};

Expand Down Expand Up @@ -59,6 +59,7 @@ mod windows {
},
);
let res = self.locator.PositionChanged(&handler)?;
trace!("Location handler registered.");
Ok(LocationHandler {
locator: &self.locator,
token: res,
Expand All @@ -74,6 +75,7 @@ mod windows {
impl<'a> Drop for LocationHandler<'a> {
fn drop(&mut self) {
let _res = self.locator.RemovePositionChanged(self.token);
trace!("Dropped location handler.");
}
}
}
Expand Down

0 comments on commit 01adbbd

Please sign in to comment.