Skip to content

Commit 38c2576

Browse files
authored
Merge pull request #190 from rpavlik/loader-manifest-search-logging
loader: Add info-level debug messages outputting all places we look for the manifest
2 parents b38a237 + 4154303 commit 38c2576

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
loader: Add "info"-level debug messages listing all the places that we look for the OpenXR active runtime manifest.

src/loader/manifest_file.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
289289
if (!out.empty()) {
290290
out += "/";
291291
out += relative_path;
292+
293+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in XDG_CONFIG_HOME: " + out);
292294
if (FileSysUtilsPathExists(out)) {
293295
return true;
294296
}
@@ -303,6 +305,7 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
303305
out = path;
304306
out += "/";
305307
out += relative_path;
308+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in an entry of XDG_CONFIG_DIRS: " + out);
306309
if (FileSysUtilsPathExists(out)) {
307310
return true;
308311
}
@@ -311,6 +314,7 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
311314
out = SYSCONFDIR;
312315
out += "/";
313316
out += relative_path;
317+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in compiled-in SYSCONFDIR: " + out);
314318
if (FileSysUtilsPathExists(out)) {
315319
return true;
316320
}
@@ -319,6 +323,7 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
319323
out = EXTRASYSCONFDIR;
320324
out += "/";
321325
out += relative_path;
326+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in compiled-in EXTRASYSCONFDIR: " + out);
322327
if (FileSysUtilsPathExists(out)) {
323328
return true;
324329
}
@@ -536,6 +541,7 @@ void RuntimeManifestFile::CreateIfValid(std::string const &filename,
536541
std::vector<std::unique_ptr<RuntimeManifestFile>> &manifest_files) {
537542
std::ifstream json_stream(filename, std::ifstream::in);
538543

544+
LoaderLogger::LogInfoMessage("", "RuntimeManifestFile::CreateIfValid - attempting to load " + filename);
539545
std::ostringstream error_ss("RuntimeManifestFile::CreateIfValid ");
540546
if (!json_stream.is_open()) {
541547
error_ss << "failed to open " << filename << ". Does it exist?";
@@ -630,6 +636,8 @@ XrResult RuntimeManifestFile::FindManifestFiles(ManifestFileType type,
630636
"", "RuntimeManifestFile::FindManifestFiles - found too many default runtime files in registry");
631637
}
632638
filename = filenames[0];
639+
LoaderLogger::LogInfoMessage("",
640+
"RuntimeManifestFile::FindManifestFiles - using registry-specified runtime file " + filename);
633641
#elif defined(XR_OS_LINUX)
634642
const std::string relative_path =
635643
"openxr/" + std::to_string(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)) + "/active_runtime.json";
@@ -645,9 +653,7 @@ XrResult RuntimeManifestFile::FindManifestFiles(ManifestFileType type,
645653
return XR_ERROR_FILE_ACCESS_ERROR;
646654
}
647655
#endif
648-
std::string info_message = "RuntimeManifestFile::FindManifestFiles - using global runtime file ";
649-
info_message += filename;
650-
LoaderLogger::LogInfoMessage("", info_message);
656+
LoaderLogger::LogInfoMessage("", "RuntimeManifestFile::FindManifestFiles - using global runtime file " + filename);
651657
}
652658
RuntimeManifestFile::CreateIfValid(filename, manifest_files);
653659
return result;

0 commit comments

Comments
 (0)