From 81eac8777e6ac486b29093c2a3b7a974723fc57c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 20 Feb 2018 14:26:23 +0100 Subject: [PATCH] Add logging facilities in participant device and server group chat room. --- src/chat/chat-room/server-group-chat-room-stub.cpp | 6 ++++++ src/chat/chat-room/server-group-chat-room.h | 2 ++ src/conference/participant-device.cpp | 14 ++++++++++++++ src/conference/participant-device.h | 2 ++ 4 files changed, 24 insertions(+) diff --git a/src/chat/chat-room/server-group-chat-room-stub.cpp b/src/chat/chat-room/server-group-chat-room-stub.cpp index 90950be2f..03d88eea3 100644 --- a/src/chat/chat-room/server-group-chat-room-stub.cpp +++ b/src/chat/chat-room/server-group-chat-room-stub.cpp @@ -215,4 +215,10 @@ void ServerGroupChatRoom::leave () {} void ServerGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {} +// ----------------------------------------------------------------------------- + +ostream &operator<< (ostream &stream, const ServerGroupChatRoom *chatRoom) { + return stream << "ServerGroupChatRoom [" << chatRoom << "]"; +} + LINPHONE_END_NAMESPACE diff --git a/src/chat/chat-room/server-group-chat-room.h b/src/chat/chat-room/server-group-chat-room.h index fa4fd0ab4..57d49dcfc 100644 --- a/src/chat/chat-room/server-group-chat-room.h +++ b/src/chat/chat-room/server-group-chat-room.h @@ -93,6 +93,8 @@ private: L_DISABLE_COPY(ServerGroupChatRoom); }; +std::ostream &operator<< (std::ostream &stream, const ServerGroupChatRoom *chatRoom); + LINPHONE_END_NAMESPACE #endif // ifndef _L_SERVER_GROUP_CHAT_ROOM_H_ diff --git a/src/conference/participant-device.cpp b/src/conference/participant-device.cpp index e04ecef3f..4c147a38d 100644 --- a/src/conference/participant-device.cpp +++ b/src/conference/participant-device.cpp @@ -47,4 +47,18 @@ void ParticipantDevice::setConferenceSubscribeEvent (LinphoneEvent *ev) { mConferenceSubscribeEvent = linphone_event_ref(ev); } +ostream &operator<< (ostream &stream, ParticipantDevice::State state) { + switch (state) { + case ParticipantDevice::State::Joining: + return stream << "Joining"; + case ParticipantDevice::State::Present: + return stream << "Present"; + case ParticipantDevice::State::Leaving: + return stream << "Leaving"; + case ParticipantDevice::State::Left: + return stream << "Left"; + } + return stream; +} + LINPHONE_END_NAMESPACE diff --git a/src/conference/participant-device.h b/src/conference/participant-device.h index f1abe8e1e..e10da6394 100644 --- a/src/conference/participant-device.h +++ b/src/conference/participant-device.h @@ -72,6 +72,8 @@ private: L_DISABLE_COPY(ParticipantDevice); }; +std::ostream &operator<< (std::ostream &stream, ParticipantDevice::State state); + LINPHONE_END_NAMESPACE #endif // ifndef _L_PARTICIPANT_DEVICE_H_