diff options
author | Roxanne Skelly <roxie@lindenlab.com> | 2024-08-01 09:33:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 09:33:33 -0700 |
commit | 5f66a15142083a047ac945da94f167c24c95f49a (patch) | |
tree | 1f88fac45393977ec286e2635f2ff08ab608e830 /indra/newview | |
parent | 89d5e8bf4fc481be08800a30c1fe14baa170ba7e (diff) | |
parent | b9c222dfaeb4531f91f6e0bb02bb4b0da599d08b (diff) |
Merge pull request #2162 from secondlife/roxie/webrtc-voice-crash-detect
[WebRTC] Implement a Logging Sink for WebRTC
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llvoicewebrtc.h | 9 |
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 //@{ |