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

Unified Diff: unclean_shutdown_collector.cc

Issue 6517001: crash-reporter: Use standard logging and new libchromeos Process code (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crash-reporter.git@master
Patch Set: More comments Created 9 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 | « test_helpers.h ('k') | unclean_shutdown_collector_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unclean_shutdown_collector.cc
diff --git a/unclean_shutdown_collector.cc b/unclean_shutdown_collector.cc
index 1e1c7842a66de998c5f8c6fab50a6dc485b143c2..ad7386f261db3baf678de2095ffe99cfd01310e3 100644
--- a/unclean_shutdown_collector.cc
+++ b/unclean_shutdown_collector.cc
@@ -6,7 +6,6 @@
#include "base/file_util.h"
#include "base/logging.h"
-#include "crash-reporter/system_logging.h"
static const char kUncleanShutdownFile[] =
"/var/lib/crash_reporter/pending_clean_shutdown";
@@ -32,7 +31,7 @@ bool UncleanShutdownCollector::Enable() {
FilePath file_path(unclean_shutdown_file_);
file_util::CreateDirectory(file_path.DirName());
if (file_util::WriteFile(file_path, "", 0) != 0) {
- logger_->LogError("Unable to create shutdown check file");
+ LOG(ERROR) << "Unable to create shutdown check file";
return false;
}
return true;
@@ -40,8 +39,8 @@ bool UncleanShutdownCollector::Enable() {
bool UncleanShutdownCollector::DeleteUncleanShutdownFiles() {
if (!file_util::Delete(FilePath(unclean_shutdown_file_), false)) {
- logger_->LogError("Failed to delete unclean shutdown file %s",
- unclean_shutdown_file_);
+ LOG(ERROR) << "Failed to delete unclean shutdown file "
+ << unclean_shutdown_file_;
return false;
}
// Delete power manager trace files if they exist.
@@ -55,7 +54,7 @@ bool UncleanShutdownCollector::Collect() {
if (!file_util::PathExists(unclean_file_path)) {
return false;
}
- logger_->LogWarning("Last shutdown was not clean");
+ LOG(WARNING) << "Last shutdown was not clean";
if (DeadBatteryCausedUncleanShutdown()) {
DeleteUncleanShutdownFiles();
return false;
@@ -69,7 +68,7 @@ bool UncleanShutdownCollector::Collect() {
}
bool UncleanShutdownCollector::Disable() {
- logger_->LogInfo("Clean shutdown signalled");
+ LOG(INFO) << "Clean shutdown signalled";
return DeleteUncleanShutdownFiles();
}
@@ -77,16 +76,16 @@ bool UncleanShutdownCollector::DeadBatteryCausedUncleanShutdown()
{
// Check for case of battery running out while suspended.
if (file_util::PathExists(powerd_suspended_file_)) {
- logger_->LogInfo("Unclean shutdown occurred while suspended. Not counting "
- "toward unclean shutdown statistic.");
+ LOG(INFO) << "Unclean shutdown occurred while suspended. Not counting "
+ << "toward unclean shutdown statistic.";
return true;
}
// Check for case of battery running out after resuming from a low-battery
// suspend.
if (file_util::PathExists(powerd_low_battery_file_)) {
- logger_->LogInfo("Unclean shutdown occurred while running with battery "
- "critically low. Not counting toward unclean shutdown "
- "statistic.");
+ LOG(INFO) << "Unclean shutdown occurred while running with battery "
+ << "critically low. Not counting toward unclean shutdown "
+ << "statistic.";
return true;
}
return false;
« no previous file with comments | « test_helpers.h ('k') | unclean_shutdown_collector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698