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

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

Issue 14247011: drive: Change EventLogger to take printf format (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/drive/event_logger.cc
diff --git a/chrome/browser/chromeos/drive/event_logger.cc b/chrome/browser/chromeos/drive/event_logger.cc
index 446aed976bc111e3bd28f6a710a1d9d99e99713f..d31a087135e3aab223f490df51b1a2ca07ff03da 100644
--- a/chrome/browser/chromeos/drive/event_logger.cc
+++ b/chrome/browser/chromeos/drive/event_logger.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/drive/event_logger.h"
+#include "base/stringprintf.h"
+
namespace drive {
EventLogger::Event::Event(int id, const std::string& what)
@@ -20,7 +22,14 @@ EventLogger::EventLogger(size_t history_size)
EventLogger::~EventLogger() {
}
-void EventLogger::Log(const std::string& what) {
+void EventLogger::Log(const char* format, ...) {
+ std::string what;
+
+ va_list args;
+ va_start(args, format);
+ base::StringAppendV(&what, format, args);
+ va_end(args);
+
history_.push_back(Event(next_event_id_, what));
++next_event_id_;
if (history_.size() > history_size_)
« no previous file with comments | « chrome/browser/chromeos/drive/event_logger.h ('k') | chrome/browser/chromeos/drive/event_logger_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698