From 930bf680c2d184b8678a0c42a8d3a0d30e104643 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Mon, 3 Jun 2019 21:37:43 +0300
Subject: [PATCH] SL-10423 Dump path data when missing critical file

---
 indra/llui/lltransutil.cpp    |  1 +
 indra/llvfs/lldir.cpp         | 34 +++++++++++++++++-----------------
 indra/llvfs/lldir.h           |  2 +-
 indra/newview/llappviewer.cpp |  1 +
 4 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp
index b1534bb5e4a..5da722a72bb 100644
--- a/indra/llui/lltransutil.cpp
+++ b/indra/llui/lltransutil.cpp
@@ -44,6 +44,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s
 	bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root, LLDir::ALL_SKINS);
 	if (!success)
 	{
+		gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN);
 		LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from  https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL;
 		return false;
 	}
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index 18836e54b0f..2076ce334e4 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -1033,24 +1033,24 @@ bool LLDir::setCacheDir(const std::string &path)
 	}
 }
 
-void LLDir::dumpCurrentDirectories()
+void LLDir::dumpCurrentDirectories(LLError::ELevel level)
 {
-	LL_DEBUGS("AppInit","Directories") << "Current Directories:" << LL_ENDL;
-
-	LL_DEBUGS("AppInit","Directories") << "  CurPath:               " << getCurPath() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  AppName:               " << getAppName() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  ExecutableFilename:    " << getExecutableFilename() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  ExecutableDir:         " << getExecutableDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  WorkingDir:            " << getWorkingDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  AppRODataDir:          " << getAppRODataDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  OSUserDir:             " << getOSUserDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  OSUserAppDir:          " << getOSUserAppDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  LindenUserDir:         " << getLindenUserDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  TempDir:               " << getTempDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  CAFile:				 " << getCAFile() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  SkinBaseDir:           " << getSkinBaseDir() << LL_ENDL;
-	LL_DEBUGS("AppInit","Directories") << "  SkinDir:               " << getSkinDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit","Directories") << "Current Directories:" << LL_ENDL;
+
+	LL_VLOGS(level, "AppInit", "Directories") << "  CurPath:               " << getCurPath() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  AppName:               " << getAppName() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  ExecutableFilename:    " << getExecutableFilename() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  ExecutableDir:         " << getExecutableDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  WorkingDir:            " << getWorkingDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  AppRODataDir:          " << getAppRODataDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  OSUserDir:             " << getOSUserDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  OSUserAppDir:          " << getOSUserAppDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  LindenUserDir:         " << getLindenUserDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  TempDir:               " << getTempDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  CAFile:                " << getCAFile() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  SkinBaseDir:           " << getSkinBaseDir() << LL_ENDL;
+	LL_VLOGS(level, "AppInit", "Directories") << "  SkinDir:               " << getSkinDir() << LL_ENDL;
 }
 
 void LLDir::append(std::string& destpath, const std::string& name) const
diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h
index e233413a7f4..38e204ef047 100644
--- a/indra/llvfs/lldir.h
+++ b/indra/llvfs/lldir.h
@@ -194,7 +194,7 @@ class LLDir
 	virtual bool setCacheDir(const std::string &path);
 	virtual void updatePerAccountChatLogsDir();
 
-	virtual void dumpCurrentDirectories();
+	virtual void dumpCurrentDirectories(LLError::ELevel level = LLError::LEVEL_DEBUG);
 
 	// Utility routine
 	std::string buildSLOSCacheDir() const;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index be5611899ae..e201d56815f 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2882,6 +2882,7 @@ void LLAppViewer::initStrings()
 	if (strings_path_full.empty() || !LLFile::isfile(strings_path_full))
 	{
 		// initial check to make sure files are there failed
+		gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN);
 		LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from  https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL;
 	}
 	LLTransUtil::parseStrings(strings_file, default_trans_args);
-- 
GitLab