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

Unified Diff: chrome/test/chromedriver/chrome/log.cc

Issue 14591005: C++ readability review from original change https://chromiumcodereview.appspot.com/14263024/ (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Fix types in CHECK comparisons. Created 7 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
« no previous file with comments | « chrome/test/chromedriver/chrome/log.h ('k') | chrome/test/chromedriver/chrome/performance_logger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/log.cc
diff --git a/chrome/test/chromedriver/chrome/log.cc b/chrome/test/chromedriver/chrome/log.cc
index 03afae1ad3a061f41ce16568afed476bac04d741..6bb8a60a306c6610456325ce8e10600d76193cd6 100644
--- a/chrome/test/chromedriver/chrome/log.cc
+++ b/chrome/test/chromedriver/chrome/log.cc
@@ -78,8 +78,8 @@ std::string ConvertForDisplay(const std::string& input) {
} // namespace
-void Log::AddEntry(Log::Level level, const std::string& message) {
- return AddEntry(base::Time::Now(), level, message);
+void Log::AddEntry(Level level, const std::string& message) {
+ AddEntryTimestamped(base::Time::Now(), level, message);
}
Logger::Logger() : min_log_level_(kLog), start_(base::Time::Now()) {}
@@ -89,9 +89,9 @@ Logger::Logger(Level min_log_level)
Logger::~Logger() {}
-void Logger::AddEntry(const base::Time& time,
- Level level,
- const std::string& message) {
+void Logger::AddEntryTimestamped(const base::Time& timestamp,
+ Level level,
+ const std::string& message) {
if (level < min_log_level_)
return;
@@ -114,7 +114,7 @@ void Logger::AddEntry(const base::Time& time,
}
std::string entry =
base::StringPrintf("[%.3lf][%s]: %s",
- base::TimeDelta(time - start_).InSecondsF(),
+ base::TimeDelta(timestamp - start_).InSecondsF(),
level_name,
ConvertForDisplay(message).c_str());
const char* format = "%s\n";
« no previous file with comments | « chrome/test/chromedriver/chrome/log.h ('k') | chrome/test/chromedriver/chrome/performance_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698