Index: device/hid/hid_service_mac.cc |
diff --git a/device/hid/hid_service_mac.cc b/device/hid/hid_service_mac.cc |
index de6861de676ca45a012270b41939625a39cb0469..b21ebb51de9b0ca975ff8ba69ddcf67ec062d1d2 100644 |
--- a/device/hid/hid_service_mac.cc |
+++ b/device/hid/hid_service_mac.cc |
@@ -21,6 +21,7 @@ |
#include "base/strings/sys_string_conversions.h" |
#include "base/thread_task_runner_handle.h" |
#include "base/threading/thread_restrictions.h" |
+#include "components/device_event_log/device_event_log.h" |
#include "device/hid/hid_connection_mac.h" |
namespace device { |
@@ -96,8 +97,8 @@ HidServiceMac::HidServiceMac( |
this, |
&iterator); |
if (result != kIOReturnSuccess) { |
- LOG(ERROR) << "Failed to listen for device arrival: " |
- << base::StringPrintf("0x%04x", result); |
+ HID_LOG(ERROR) << "Failed to listen for device arrival: " |
+ << base::StringPrintf("0x%04x", result); |
return; |
} |
@@ -113,8 +114,8 @@ HidServiceMac::HidServiceMac( |
this, |
&iterator); |
if (result != kIOReturnSuccess) { |
- LOG(ERROR) << "Failed to listen for device removal: " |
- << base::StringPrintf("0x%04x", result); |
+ HID_LOG(ERROR) << "Failed to listen for device removal: " |
+ << base::StringPrintf("0x%04x", result); |
return; |
} |
@@ -140,7 +141,7 @@ void HidServiceMac::Connect(const HidDeviceId& device_id, |
base::mac::ScopedIOObject<io_service_t> service( |
IORegistryEntryFromPath(kIOMasterPortDefault, service_path)); |
if (!service.get()) { |
- VLOG(1) << "IOService not found for path: " << device_id; |
+ HID_LOG(EVENT) << "IOService not found for path: " << device_id; |
task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr)); |
return; |
} |
@@ -148,15 +149,15 @@ void HidServiceMac::Connect(const HidDeviceId& device_id, |
base::ScopedCFTypeRef<IOHIDDeviceRef> hid_device( |
IOHIDDeviceCreate(kCFAllocatorDefault, service)); |
if (!hid_device) { |
- VLOG(1) << "Unable to create IOHIDDevice object."; |
+ HID_LOG(EVENT) << "Unable to create IOHIDDevice object."; |
task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr)); |
return; |
} |
IOReturn result = IOHIDDeviceOpen(hid_device, kIOHIDOptionsTypeNone); |
if (result != kIOReturnSuccess) { |
- VLOG(1) << "Failed to open device: " << base::StringPrintf("0x%04x", |
- result); |
+ HID_LOG(EVENT) << "Failed to open device: " << base::StringPrintf("0x%04x", |
+ result); |
task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr)); |
return; |
} |
@@ -229,23 +230,24 @@ scoped_refptr<HidDeviceInfo> HidServiceMac::CreateDeviceInfo( |
IOReturn result = |
IORegistryEntryGetPath(service, kIOServicePlane, service_path); |
if (result != kIOReturnSuccess) { |
- VLOG(1) << "Failed to get IOService path: " << base::StringPrintf("0x%04x", |
- result); |
+ HID_LOG(EVENT) << "Failed to get IOService path: " << base::StringPrintf( |
+ "0x%04x", result); |
return nullptr; |
} |
base::ScopedCFTypeRef<IOHIDDeviceRef> hid_device( |
IOHIDDeviceCreate(kCFAllocatorDefault, service)); |
if (!hid_device) { |
- VLOG(1) << "Unable to create IOHIDDevice object for " << service_path |
- << "."; |
+ HID_LOG(EVENT) << "Unable to create IOHIDDevice object for " << service_path |
+ << "."; |
return nullptr; |
} |
std::vector<uint8> report_descriptor; |
if (!TryGetHidDataProperty(hid_device, CFSTR(kIOHIDReportDescriptorKey), |
&report_descriptor)) { |
- VLOG(1) << "Unable to get report descriptor for " << service_path << "."; |
+ HID_LOG(EVENT) << "Unable to get report descriptor for " << service_path |
+ << "."; |
return nullptr; |
} |