diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-12-31 00:58:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-12-31 00:58:40 +0100 |
| commit | 24b83514fed0683008bff23c6fd9c1d990a30b02 (patch) | |
| tree | c3950e60394f3d3a44212af683102f3183dd6454 | |
| parent | 91bf9a14004611b68eb4e68927b4dad41b578e15 (diff) | |
Better logging to help with #2701.
| -rw-r--r-- | src/lib/cross_osx.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 5596e6ecb..2455ad190 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -378,11 +378,15 @@ Drive::get () using namespace boost::algorithm; vector<OSXDisk> disks; + LOG_DISK_NC("Drive::get() starts"); + auto session = DASessionCreate(kCFAllocatorDefault); if (!session) { return {}; } + LOG_DISK_NC("Drive::get() has session"); + DARegisterDiskAppearedCallback (session, NULL, disk_appeared, &disks); auto run_loop = CFRunLoopGetCurrent (); DASessionScheduleWithRunLoop (session, run_loop, kCFRunLoopDefaultMode); @@ -391,7 +395,14 @@ Drive::get () DAUnregisterCallback(session, (void *) disk_appeared, &disks); CFRelease(session); - return osx_disks_to_drives (disks); + auto drives = osx_disks_to_drives(disks); + + LOG_DISK("Drive::get() found %1 drives:", drives.size()); + for (auto const& drive: drives) { + LOG_DISK("%1 %2 mounted=%3", drive.description(), drive.device(), drive.mounted()); + } + + return drives; } |
