Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3201)

Unified Diff: device/hid/hid_service_linux.cc

Issue 947663002: Log device/hid messages to chrome://device-log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A better comment about the embedded log instance. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/hid/hid_service_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service_linux.cc
diff --git a/device/hid/hid_service_linux.cc b/device/hid/hid_service_linux.cc
index 6174d41e33bbb9df7a6c304c9184f2b5d7aba72e..500f7b8c3b61f142f3cd06864c57cf9d94e7158a 100644
--- a/device/hid/hid_service_linux.cc
+++ b/device/hid/hid_service_linux.cc
@@ -13,12 +13,12 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/location.h"
-#include "base/logging.h"
#include "base/scoped_observer.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.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/device_monitor_linux.h"
#include "device/hid/hid_connection_linux.h"
#include "device/hid/hid_device_info_linux.h"
@@ -282,29 +282,30 @@ void HidServiceLinux::OpenDevice(scoped_ptr<ConnectParams> params) {
base::File::Error file_error = device_file.error_details();
if (file_error == base::File::FILE_ERROR_ACCESS_DENIED) {
- VLOG(1) << "Access denied opening device read-write, trying read-only.";
+ HID_LOG(EVENT)
+ << "Access denied opening device read-write, trying read-only.";
flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
device_file.Initialize(device_path, flags);
}
}
if (!device_file.IsValid()) {
- LOG(ERROR) << "Failed to open '" << params->device_info->device_node()
- << "': "
- << base::File::ErrorToString(device_file.error_details());
+ HID_LOG(EVENT) << "Failed to open '" << params->device_info->device_node()
+ << "': "
+ << base::File::ErrorToString(device_file.error_details());
task_runner->PostTask(FROM_HERE, base::Bind(params->callback, nullptr));
return;
}
int result = fcntl(device_file.GetPlatformFile(), F_GETFL);
if (result == -1) {
- PLOG(ERROR) << "Failed to get flags from the device file descriptor";
+ HID_PLOG(ERROR) << "Failed to get flags from the device file descriptor";
task_runner->PostTask(FROM_HERE, base::Bind(params->callback, nullptr));
return;
}
result = fcntl(device_file.GetPlatformFile(), F_SETFL, result | O_NONBLOCK);
if (result == -1) {
- PLOG(ERROR) << "Failed to set the non-blocking flag on the device fd";
+ HID_PLOG(ERROR) << "Failed to set the non-blocking flag on the device fd";
task_runner->PostTask(FROM_HERE, base::Bind(params->callback, nullptr));
return;
}
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/hid/hid_service_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698