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

Unified Diff: components/policy/core/common/remote_commands/remote_commands_service.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: components/policy/core/common/remote_commands/remote_commands_service.cc
diff --git a/components/policy/core/common/remote_commands/remote_commands_service.cc b/components/policy/core/common/remote_commands/remote_commands_service.cc
index c547f8e1155450b845e104b79660228f555538ca..738c1b85adf6e60558ac611cf7594f22b0d23327 100644
--- a/components/policy/core/common/remote_commands/remote_commands_service.cc
+++ b/components/policy/core/common/remote_commands/remote_commands_service.cc
@@ -9,7 +9,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/logging.h"
+#include "base/chromeos/logging.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
@@ -78,7 +78,7 @@ void RemoteCommandsService::SetClockForTesting(
void RemoteCommandsService::EnqueueCommand(
const enterprise_management::RemoteCommand& command) {
if (!command.has_type() || !command.has_unique_id()) {
- LOG(WARNING) << "Invalid remote command from server.";
+ CHROMEOS_SYSLOG(ERROR) << "Invalid remote command from server.";
return;
}
@@ -94,6 +94,7 @@ void RemoteCommandsService::EnqueueCommand(
factory_->BuildJobForType(command.type());
if (!job || !job->Init(queue_.GetNowTicks(), command)) {
+ CHROMEOS_SYSLOG(ERROR) << "Initialization of remote command failed.";
em::RemoteCommandResult ignored_result;
ignored_result.set_result(
em::RemoteCommandResult_ResultType_RESULT_IGNORED);
@@ -138,6 +139,9 @@ void RemoteCommandsService::OnJobFinished(RemoteCommandJob* command) {
NOTREACHED();
}
+ CHROMEOS_SYSLOG(WARNING) << "Remote command " << command->unique_id()
+ << " finished with result " << result.result();
+
unsent_results_.push_back(result);
FetchRemoteCommands();
« no previous file with comments | « components/policy/core/common/remote_commands/remote_command_job.cc ('k') | ui/base/user_activity/user_activity_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698