From e361ae79fa103456a6db2caf330e58f4a6860549 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Fri, 26 Jul 2024 18:32:33 -0700 Subject: [PATCH] Show location ID and registry entry ID in hex in debug format --- src/enumeration.rs | 7 +++++-- src/platform/macos_iokit/enumeration.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/enumeration.rs b/src/enumeration.rs index 6fa8f05..d22a2ae 100644 --- a/src/enumeration.rs +++ b/src/enumeration.rs @@ -259,8 +259,11 @@ impl std::fmt::Debug for DeviceInfo { #[cfg(target_os = "macos")] { - s.field("location_id", &self.location_id); - s.field("registry_entry_id", &self.registry_id); + s.field("location_id", &format_args!("0x{:08X}", self.location_id)); + s.field( + "registry_entry_id", + &format_args!("0x{:08X}", self.registry_id), + ); } s.field("interfaces", &self.interfaces); diff --git a/src/platform/macos_iokit/enumeration.rs b/src/platform/macos_iokit/enumeration.rs index 1a99b15..48208db 100644 --- a/src/platform/macos_iokit/enumeration.rs +++ b/src/platform/macos_iokit/enumeration.rs @@ -47,7 +47,7 @@ pub(crate) fn service_by_registry_id(registry_id: u64) -> Result Option { let registry_id = get_id(&device)?; - log::debug!("Probing device {registry_id}"); + log::debug!("Probing device {registry_id:08x}"); // Can run `ioreg -p IOUSB -l` to see all properties Some(DeviceInfo {