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

Unified Diff: chrome/browser/chromeos/policy/status_uploader.cc

Issue 2412963003: Replace CHROMEOS_SYSLOG logs with SYSLOG logs so remote command related (Closed)
Patch Set: Created 4 years, 2 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/status_uploader.cc
diff --git a/chrome/browser/chromeos/policy/status_uploader.cc b/chrome/browser/chromeos/policy/status_uploader.cc
index 10b1c7197e89d98d4df4a0b25f01ff202a5e4284..0c42579c80b2a9cfca3f18b12147f6e9412bf4cc 100644
--- a/chrome/browser/chromeos/policy/status_uploader.cc
+++ b/chrome/browser/chromeos/policy/status_uploader.cc
@@ -9,10 +9,10 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/chromeos/logging.h"
#include "base/location.h"
#include "base/sequenced_task_runner.h"
#include "base/sys_info.h"
+#include "base/syslog_logging.h"
#include "chrome/browser/chromeos/policy/device_local_account.h"
#include "chrome/browser/chromeos/policy/device_status_collector.h"
#include "chromeos/settings/cros_settings_names.h"
@@ -111,9 +111,9 @@ void StatusUploader::RefreshUploadFrequency() {
// want to use the last trusted value).
int frequency;
if (settings->GetInteger(chromeos::kReportUploadFrequency, &frequency)) {
- CHROMEOS_SYSLOG(WARNING) << "Changing status upload frequency from "
- << upload_frequency_ << " to "
- << base::TimeDelta::FromMilliseconds(frequency);
+ SYSLOG(INFO) << "Changing status upload frequency from "
+ << upload_frequency_ << " to "
+ << base::TimeDelta::FromMilliseconds(frequency);
upload_frequency_ = base::TimeDelta::FromMilliseconds(
std::max(kMinUploadDelayMs, frequency));
}
@@ -131,8 +131,7 @@ bool StatusUploader::IsSessionDataUploadAllowed() {
std::unique_ptr<DeviceLocalAccount> account =
collector_->GetAutoLaunchedKioskSessionInfo();
if (!account) {
- CHROMEOS_SYSLOG(WARNING)
- << "Not a kiosk session, data upload is not allowed.";
+ SYSLOG(WARNING) << "Not a kiosk session, data upload is not allowed.";
return false;
}
@@ -142,19 +141,17 @@ bool StatusUploader::IsSessionDataUploadAllowed() {
std::string last_activity_name =
ui::UserActivityDetector::Get()->last_activity_name();
if (!last_activity_time.is_null()) {
- CHROMEOS_SYSLOG(WARNING)
- << "User input " << last_activity_name << " detected "
- << (base::TimeTicks::Now() - last_activity_time) << " ago ("
- << (base::SysInfo::Uptime() -
- (base::TimeTicks::Now() - last_activity_time))
- << " after last boot), data upload is not allowed.";
+ SYSLOG(WARNING) << "User input " << last_activity_name << " detected "
+ << (base::TimeTicks::Now() - last_activity_time) << " ago ("
+ << (base::SysInfo::Uptime() -
+ (base::TimeTicks::Now() - last_activity_time))
+ << " after last boot), data upload is not allowed.";
return false;
}
// Screenshot is allowed as long as we have not captured media.
if (has_captured_media_) {
- CHROMEOS_SYSLOG(WARNING)
- << "Media has been captured, data upload is not allowed.";
+ SYSLOG(WARNING) << "Media has been captured, data upload is not allowed.";
return false;
} else {
return true;
@@ -187,16 +184,15 @@ void StatusUploader::OnStatusReceived(
bool have_device_status = device_status != nullptr;
bool have_session_status = session_status != nullptr;
if (!have_device_status && !have_session_status) {
- CHROMEOS_SYSLOG(WARNING)
- << "Skipping status upload because no data to upload";
+ SYSLOG(INFO) << "Skipping status upload because no data to upload";
// Don't have any status to upload - just set our timer for next time.
last_upload_ = base::Time::NowFromSystemTime();
ScheduleNextStatusUpload();
return;
}
- CHROMEOS_SYSLOG(WARNING) << "Starting status upload: have_device_status = "
- << have_device_status;
+ SYSLOG(INFO) << "Starting status upload: have_device_status = "
+ << have_device_status;
client_->UploadDeviceStatus(device_status.get(), session_status.get(),
base::Bind(&StatusUploader::OnUploadCompleted,
weak_factory_.GetWeakPtr()));
@@ -207,9 +203,11 @@ void StatusUploader::OnUploadCompleted(bool success) {
// or not (we don't change the time of the next upload based on whether this
// upload succeeded or not - if a status upload fails, we just skip it and
// wait until it's time to try again.
- CHROMEOS_SYSLOG_IF(ERROR, !success) << "Error uploading status: "
- << client_->status();
- CHROMEOS_SYSLOG_IF(WARNING, success) << "Status upload successful";
+ if (success) {
+ SYSLOG(INFO) << "Status upload successful";
+ } else {
+ SYSLOG(ERROR) << "Error uploading status: " << client_->status();
+ }
last_upload_ = base::Time::NowFromSystemTime();
// If the upload was successful, tell the collector so it can clear its cache

Powered by Google App Engine
This is Rietveld 408576698