Skip to content

Commit 4154303

Browse files
committed
loader: Add info-level debug messages outputting all places we look for the manifest
1 parent 3e40561 commit 4154303

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
@@ -288,6 +288,8 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
288288
if (!out.empty()) {
289289
out += "/";
290290
out += relative_path;
291+
292+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in XDG_CONFIG_HOME: " + out);
291293
if (FileSysUtilsPathExists(out)) {
292294
return true;
293295
}
@@ -302,6 +304,7 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
302304
out = path;
303305
out += "/";
304306
out += relative_path;
307+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in an entry of XDG_CONFIG_DIRS: " + out);
305308
if (FileSysUtilsPathExists(out)) {
306309
return true;
307310
}
@@ -310,6 +313,7 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
310313
out = SYSCONFDIR;
311314
out += "/";
312315
out += relative_path;
316+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in compiled-in SYSCONFDIR: " + out);
313317
if (FileSysUtilsPathExists(out)) {
314318
return true;
315319
}
@@ -318,6 +322,7 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
318322
out = EXTRASYSCONFDIR;
319323
out += "/";
320324
out += relative_path;
325+
LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in compiled-in EXTRASYSCONFDIR: " + out);
321326
if (FileSysUtilsPathExists(out)) {
322327
return true;
323328
}
@@ -535,6 +540,7 @@ void RuntimeManifestFile::CreateIfValid(std::string const &filename,
535540
std::vector<std::unique_ptr<RuntimeManifestFile>> &manifest_files) {
536541
std::ifstream json_stream(filename, std::ifstream::in);
537542

543+
LoaderLogger::LogInfoMessage("", "RuntimeManifestFile::CreateIfValid - attempting to load " + filename);
538544
std::ostringstream error_ss("RuntimeManifestFile::CreateIfValid ");
539545
if (!json_stream.is_open()) {
540546
error_ss << "failed to open " << filename << ". Does it exist?";
@@ -629,6 +635,8 @@ XrResult RuntimeManifestFile::FindManifestFiles(ManifestFileType type,
629635
"", "RuntimeManifestFile::FindManifestFiles - found too many default runtime files in registry");
630636
}
631637
filename = filenames[0];
638+
LoaderLogger::LogInfoMessage("",
639+
"RuntimeManifestFile::FindManifestFiles - using registry-specified runtime file " + filename);
632640
#elif defined(XR_OS_LINUX)
633641
const std::string relative_path =
634642
"openxr/" + std::to_string(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)) + "/active_runtime.json";
@@ -644,9 +652,7 @@ XrResult RuntimeManifestFile::FindManifestFiles(ManifestFileType type,
644652
return XR_ERROR_FILE_ACCESS_ERROR;
645653
}
646654
#endif
647-
std::string info_message = "RuntimeManifestFile::FindManifestFiles - using global runtime file ";
648-
info_message += filename;
649-
LoaderLogger::LogInfoMessage("", info_message);
655+
LoaderLogger::LogInfoMessage("", "RuntimeManifestFile::FindManifestFiles - using global runtime file " + filename);
650656
}
651657
RuntimeManifestFile::CreateIfValid(filename, manifest_files);
652658
return result;

0 commit comments

Comments
 (0)