From 88ca93d24fbc7bb9515e6d43ff4942b29a1093af Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 12 Jan 2015 19:16:47 -0500 Subject: [PATCH] Fix vivox logging borkage. Thankies to Drake/Alchemy~ --- indra/newview/llvoicevivox.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9fd41d8a6..a15f4bf8f 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -507,14 +507,22 @@ bool LLVivoxVoiceClient::writeString(const std::string &str) void LLVivoxVoiceClient::connectorCreate() { std::ostringstream stream; - std::string logpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); std::string loglevel = "0"; // Transition to stateConnectorStarted when the connector handle comes back. setState(stateConnectorStarting); - std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel"); + std::string logpath = gSavedSettings.getString("VivoxLogDirectory"); + if (logpath.empty()) + { + logpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + } + if (LLStringUtil::endsWith(logpath, gDirUtilp->getDirDelimiter())) + { + logpath.resize(logpath.size()-1); + } + std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel"); if(savedLogLevel != "0") { LL_DEBUGS("Voice") << "creating connector with logging enabled" << LL_ENDL; @@ -870,13 +878,18 @@ void LLVivoxVoiceClient::stateMachine() #else args += loglevel; #endif - args += " -lf "; std::string log_folder = gSavedSettings.getString("VivoxLogDirectory"); + if (log_folder.empty()) { log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); } - args += "logfolder"; + if (LLStringUtil::endsWith(log_folder, gDirUtilp->getDirDelimiter())) + { + log_folder.resize(log_folder.size()-1); + } + args += " -lf "; + args += log_folder; // Singu Note: omit shutdown timeout for Linux, as we are using 2.x version of the SDK there // Singu TODO: Remove this when the Vivox SDK 4.x is working on Linux