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

Unified Diff: chrome/browser/drive/event_logger.cc

Issue 20609006: Add severity info to drive::EventLogger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/drive/event_logger.cc
diff --git a/chrome/browser/drive/event_logger.cc b/chrome/browser/drive/event_logger.cc
index 0ba403402c6a744670f1fdbd7fe1592c676295b9..904435d76eb2cd83ed5e7fa205a24c9048a0c4a1 100644
--- a/chrome/browser/drive/event_logger.cc
+++ b/chrome/browser/drive/event_logger.cc
@@ -9,8 +9,10 @@
namespace drive {
-EventLogger::Event::Event(int id, const std::string& what)
+EventLogger::Event::Event(
+ int id, logging::LogSeverity severity, const std::string& what)
: id(id),
+ severity(severity),
when(base::Time::Now()),
what(what) {
}
@@ -23,18 +25,9 @@ EventLogger::EventLogger()
EventLogger::~EventLogger() {
}
-void EventLogger::Log(const char* format, ...) {
- std::string what;
-
- va_list args;
- va_start(args, format);
- base::StringAppendV(&what, format, args);
- va_end(args);
-
- DVLOG(1) << what;
-
+void EventLogger::Log(logging::LogSeverity severity, const std::string& what) {
base::AutoLock auto_lock(lock_);
- history_.push_back(Event(next_event_id_, what));
+ history_.push_back(Event(next_event_id_, severity, what));
++next_event_id_;
if (history_.size() > history_size_)
history_.pop_front();

Powered by Google App Engine
This is Rietveld 408576698