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 |