Skip to content

Commit

Permalink
Log incoming and outgoing XMPP stanza on the host
Browse files Browse the repository at this point in the history
Review-Url: https://codereview.chromium.org/2081793003
Cr-Commit-Position: refs/heads/master@{#401490}
  • Loading branch information
kelvinp authored and Commit bot committed Jun 23, 2016
1 parent 464a53b commit 72b35f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions remoting/base/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace remoting {
// In the future we may also consider writing to a log file instead of the
// console.
#define HOST_LOG LOG(INFO)
#define HOST_DLOG DLOG(INFO)

} // namespace remoting

Expand Down
9 changes: 9 additions & 0 deletions remoting/signaling/xmpp_signal_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "net/socket/ssl_client_socket.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/base/buffered_socket_writer.h"
#include "remoting/base/logging.h"
#include "remoting/signaling/xmpp_login_handler.h"
#include "remoting/signaling/xmpp_stream_parser.h"
#include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
Expand Down Expand Up @@ -248,6 +249,9 @@ bool XmppSignalStrategy::Core::SendStanza(
return false;
}

HOST_DLOG << "Sending outgoing stanza:\n"
<< stanza->Str()
<< "\n=========================================================";
SendMessage(stanza->Str());

// Return false if the SendMessage() call above resulted in the SignalStrategy
Expand Down Expand Up @@ -356,6 +360,11 @@ void XmppSignalStrategy::Core::OnStanza(
const std::unique_ptr<buzz::XmlElement> stanza) {
DCHECK(thread_checker_.CalledOnValidThread());


HOST_DLOG << "Received incoming stanza:\n"
<< stanza->Str()
<< "\n=========================================================";

base::ObserverListBase<Listener>::Iterator it(&listeners_);
for (Listener* listener = it.GetNext(); listener; listener = it.GetNext()) {
if (listener->OnSignalStrategyIncomingStanza(stanza.get()))
Expand Down

0 comments on commit 72b35f2

Please sign in to comment.