(Windows) Converted forward slashes to backslashes for some log output entries involving file names.

Also made some minor general log output changes in GamelistFileParser.
This commit is contained in:
Leon Styhre 2022-12-19 20:38:41 +01:00
parent 607e6f2845
commit a54d6a5568
2 changed files with 44 additions and 10 deletions

View file

@ -76,7 +76,11 @@ namespace GamelistFileParser
if (std::find(extensions.cbegin(), extensions.cend(),
Utils::FileSystem::getExtension(path)) == extensions.cend()) {
#if defined(_WIN64)
LOG(LogWarning) << "File \"" << Utils::String::replace(path, "/", "\\")
#else
LOG(LogWarning) << "File \"" << path
#endif
<< "\" is present in gamelist.xml but the extension is not "
"configured in es_systems.xml";
return nullptr;
@ -198,7 +202,7 @@ namespace GamelistFileParser
#else
LOG(LogWarning) << (type == GAME ? "File \"" : "Folder \"") << path
#endif
<< "\" does not exist, ignoring entry";
<< "\" does not exist, skipping entry";
continue;
}
@ -223,7 +227,13 @@ namespace GamelistFileParser
}
if (!file) {
LOG(LogError) << "Couldn't find or create \"" << path << "\", skipping entry";
#if defined(_WIN64)
LOG(LogWarning)
<< "Couldn't process \"" << Utils::String::replace(path, "/", "\\")
<< "\", skipping entry";
#else
LOG(LogWarning) << "Couldn't process \"" << path << "\", skipping entry";
#endif
continue;
}
else if (!file->isArcadeAsset()) {

View file

@ -1106,10 +1106,18 @@ void ThemeData::parseIncludes(const pugi::xml_node& root)
if (!(Settings::getInstance()->getBool("DebugSkipMissingThemeFiles") ||
(mCustomCollection && Settings::getInstance()->getBool(
"DebugSkipMissingThemeFilesCustomCollections")))) {
#if defined(_WIN64)
LOG(LogDebug) << Utils::String::replace(error.message, "/", "\\")
<< ": Couldn't find file \"" << node.text().get() << "\" "
<< ((node.text().get() != path) ?
"which resolves to \"" +
Utils::String::replace(path, "/", "\\") + "\"" :
#else
LOG(LogDebug) << error.message << ": Couldn't find file \"" << node.text().get()
<< "\" "
<< ((node.text().get() != path) ?
"which resolves to \"" + path + "\"" :
#endif
"");
}
return;
@ -1584,27 +1592,43 @@ void ThemeData::parseElement(const pugi::xml_node& root,
// For explicit paths, print a warning if the file couldn't be found, but
// only print a debug message if it was set using a variable.
if (str == node.text().as_string()) {
#if defined(_WIN64)
LOG(LogWarning) << Utils::String::replace(error.message, "/", "\\")
<< ": Couldn't find file \"" << node.text().get() << "\" "
<< ((node.text().get() != path) ?
"which resolves to \"" +
Utils::String::replace(path, "/", "\\") + "\"" :
#else
LOG(LogWarning)
<< error.message << ": Couldn't find file \"" << node.text().get()
<< "\" "
<< ((node.text().get() != path) ? "which resolves to \"" + path + "\"" :
"")
<< " (element type \"" << element.type << "\", name \""
<< root.attribute("name").as_string() << "\", property \"" << nodeName
<< "\")";
#endif
"")
<< " (element type \"" << element.type << "\", name \""
<< root.attribute("name").as_string() << "\", property \""
<< nodeName << "\")";
}
else if (!(Settings::getInstance()->getBool("DebugSkipMissingThemeFiles") ||
(mCustomCollection &&
Settings::getInstance()->getBool(
"DebugSkipMissingThemeFilesCustomCollections")))) {
#if defined(_WIN64)
LOG(LogDebug) << Utils::String::replace(error.message, "/", "\\")
<< ": Couldn't find file \"" << node.text().get() << "\" "
<< ((node.text().get() != path) ?
"which resolves to \"" +
Utils::String::replace(path, "/", "\\") + "\"" :
#else
LOG(LogDebug)
<< error.message << ": Couldn't find file \"" << node.text().get()
<< "\" "
<< ((node.text().get() != path) ? "which resolves to \"" + path + "\"" :
"")
<< " (element type \"" << element.type << "\", name \""
<< root.attribute("name").as_string() << "\", property \"" << nodeName
<< "\")";
#endif
"")
<< " (element type \"" << element.type << "\", name \""
<< root.attribute("name").as_string() << "\", property \""
<< nodeName << "\")";
}
}
element.properties[nodeName] = path;