diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-07-31 21:23:30 -0600 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-07-31 21:23:30 -0600 |
commit | b9c222dfaeb4531f91f6e0bb02bb4b0da599d08b (patch) | |
tree | 1f88fac45393977ec286e2635f2ff08ab608e830 /indra/newview/llvoicewebrtc.cpp | |
parent | 2582e4a47a83a201668495a956a766a1dd58967c (diff) |
Implement a Logging Sink for WebRTC
WebRTC logs now pass out of the webrtc library into a logging sink,
which converts them into SecondLife.log compatable logging calls.
This includes fatal errors and asserts, which are now logged into
SecondLife.log, and should be available in the crash logger.
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 25 |
1 files changed, 24 insertions, 1 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() |