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

Unified Diff: jingle/notifier/listener/notification_defines.cc

Issue 10828264: Clean up logging for push_notifications_*.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | jingle/notifier/listener/push_notifications_listen_task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/listener/notification_defines.cc
diff --git a/jingle/notifier/listener/notification_defines.cc b/jingle/notifier/listener/notification_defines.cc
index 2f65775d44ff223c1cd676c8db47fb3e347621b4..8c7398d550ed68dc8109c6352d9b8d5df9567007 100644
--- a/jingle/notifier/listener/notification_defines.cc
+++ b/jingle/notifier/listener/notification_defines.cc
@@ -6,6 +6,10 @@
#include <cstddef>
+#include "base/base64.h"
+#include "base/logging.h"
+#include "base/string_util.h"
+
namespace notifier {
Subscription::Subscription() {}
@@ -60,7 +64,13 @@ bool Notification::Equals(const Notification& other) const {
}
std::string Notification::ToString() const {
- return "{ channel: \"" + channel + "\", data: \"" + data + "\" }";
+ std::string printable_data;
+ if (IsStringASCII(data)) {
+ printable_data = data;
+ } else {
+ CHECK(base::Base64Encode(data, &printable_data));
rlarocque 2012/08/10 20:58:38 If this is supposed to be semi-human-readable bina
akalin 2012/08/13 20:24:15 Done.
+ }
+ return "{ channel: \"" + channel + "\", data: \"" + printable_data + "\" }";
}
} // namespace notifier
« no previous file with comments | « no previous file | jingle/notifier/listener/push_notifications_listen_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698