summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvoicewebrtc.cpp25
-rw-r--r--indra/newview/llvoicewebrtc.h9
2 files changed, 32 insertions, 2 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index c6cc2a053a..3164886494 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -250,7 +250,7 @@ LLWebRTCVoiceClient::~LLWebRTCVoiceClient()
void LLWebRTCVoiceClient::init(LLPumpIO* pump)
{
// constructor will set up LLVoiceClient::getInstance()
- llwebrtc::init();
+ llwebrtc::init(this);
mWebRTCDeviceInterface = llwebrtc::getDeviceInterface();
mWebRTCDeviceInterface->setDevicesObserver(this);
@@ -281,6 +281,29 @@ void LLWebRTCVoiceClient::cleanUp()
LL_DEBUGS("Voice") << "Exiting" << LL_ENDL;
}
+void LLWebRTCVoiceClient::LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message)
+{
+ switch (level)
+ {
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_VERBOSE:
+ LL_DEBUGS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_INFO:
+ LL_INFOS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_WARNING:
+ LL_WARNS("Voice") << message << LL_ENDL;
+ break;
+ case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_ERROR:
+ // use WARN so that we don't crash on a webrtc error.
+ // webrtc will force a crash on a fatal error.
+ LL_WARNS("Voice") << message << LL_ENDL;
+ break;
+ default:
+ break;
+ }
+}
+
// --------------------------------------------------
const LLVoiceVersionInfo& LLWebRTCVoiceClient::getVersion()
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 624b1b9bd2..8a65ef667c 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -62,7 +62,8 @@ extern const std::string WEBRTC_VOICE_SERVER_TYPE;
class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
virtual public LLVoiceModuleInterface,
public llwebrtc::LLWebRTCDevicesObserver,
- public LLMuteListObserver
+ public LLMuteListObserver,
+ public llwebrtc::LLWebRTCLogCallback
{
LLSINGLETON_C11(LLWebRTCVoiceClient);
LOG_CLASS(LLWebRTCVoiceClient);
@@ -88,6 +89,12 @@ public:
LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
+ ///////////////////
+ /// @name Logging
+ /// @{
+ void LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message) override;
+ //@}
+
/////////////////////
/// @name Tuning
//@{