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

Unified Diff: chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc

Issue 1923943003: Add logging to remote commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Syslog logging in upload_job_impl Created 4 years, 6 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
Index: chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
diff --git a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
index fca6a380dfd7ba406879c58f275dcb7b0567c068..06f1353c481b3cc18bdf3043af39d6fecd38a712 100644
--- a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
+++ b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
@@ -9,6 +9,7 @@
#include "ash/shell.h"
#include "base/bind.h"
+#include "base/chromeos/logging.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/macros.h"
@@ -109,6 +110,7 @@ enterprise_management::RemoteCommand_Type DeviceCommandScreenshotJob::GetType()
}
void DeviceCommandScreenshotJob::OnSuccess() {
+ CHROMEOS_SYSLOG(WARNING) << "Upload successful.";
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(succeeded_callback_,
@@ -116,6 +118,7 @@ void DeviceCommandScreenshotJob::OnSuccess() {
}
void DeviceCommandScreenshotJob::OnFailure(UploadJob::ErrorCode error_code) {
+ CHROMEOS_SYSLOG(ERROR) << "Upload failure: " << error_code;
ResultCode result_code = FAILURE_CLIENT;
switch (error_code) {
case UploadJob::AUTHENTICATION_ERROR:
@@ -190,8 +193,11 @@ void DeviceCommandScreenshotJob::RunImpl(
succeeded_callback_ = succeeded_callback;
failed_callback_ = failed_callback;
+ CHROMEOS_SYSLOG(WARNING) << "Executing screenshot command.";
+
// Fail if the delegate says screenshots are not allowed in this session.
if (!screenshot_delegate_->IsScreenshotAllowed()) {
+ CHROMEOS_SYSLOG(ERROR) << "Screenshots are not allowed.";
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(failed_callback_, base::Passed(base::WrapUnique(
@@ -202,7 +208,7 @@ void DeviceCommandScreenshotJob::RunImpl(
// Immediately fail if the upload url is invalid.
if (!upload_url_.is_valid()) {
- LOG(ERROR) << upload_url_ << " is not a valid URL.";
+ CHROMEOS_SYSLOG(ERROR) << upload_url_ << " is not a valid URL.";
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(failed_callback_, base::Passed(base::WrapUnique(
@@ -212,6 +218,7 @@ void DeviceCommandScreenshotJob::RunImpl(
// Immediately fail if there are no attached screens.
if (root_windows.size() == 0) {
+ CHROMEOS_SYSLOG(ERROR) << "No attached screens.";
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(failed_callback_, base::Passed(base::WrapUnique(new Payload(

Powered by Google App Engine
This is Rietveld 408576698