Some improvements to the application logging.

This commit is contained in:
Leon Styhre 2021-01-01 18:36:53 +01:00
parent ed60ab4e3a
commit f4cfcbed65
3 changed files with 7 additions and 11 deletions

View file

@ -50,7 +50,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
return treeNode; return treeNode;
if (type == FOLDER) { if (type == FOLDER) {
LOG(LogWarning) << "Gamelist: folder doesn't exist, won't create it"; LOG(LogWarning) << "A folder defined in the gamelist file does not exist:";
return nullptr; return nullptr;
} }
@ -66,7 +66,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
// Don't create folders unless they're including any games. // Don't create folders unless they're including any games.
// If the type is FOLDER it's going to be empty, so don't bother. // If the type is FOLDER it's going to be empty, so don't bother.
if (type == FOLDER) { if (type == FOLDER) {
LOG(LogWarning) << "Gamelist: folder doesn't exist, won't create it"; LOG(LogWarning) << "A folder defined in the gamelist file does not exist:";
return nullptr; return nullptr;
} }
@ -144,8 +144,7 @@ void parseGamelist(SystemData* system)
FileData* file = findOrCreateFile(system, path, type); FileData* file = findOrCreateFile(system, path, type);
if (!file) { if (!file) {
LOG(LogError) << "Error finding/creating FileData for \"" << LOG(LogError) << "Could not find or create \"" << path << "\", skipping entry";
path << "\", skipping entry";
continue; continue;
} }
else if (!file->isArcadeAsset()) { else if (!file->isArcadeAsset()) {

View file

@ -490,11 +490,9 @@ void ThemeData::parseElement(const pugi::xml_node& root,
if (!ResourceManager::getInstance()->fileExists(path)) { if (!ResourceManager::getInstance()->fileExists(path)) {
std::stringstream ss; std::stringstream ss;
// "From theme yadda yadda, included file yadda yadda. // "From theme yadda yadda, included file yadda yadda.
ss << " Warning " << error.msg; LOG(LogWarning) << error.msg << ":";
ss << "could not find file \"" << node.text().get() << "\" "; LOG(LogWarning) << "Could not find file \"" << node.text().get() << "\" " <<
if (node.text().get() != path) ((node.text().get() != path) ? "which resolves to \"" + path + "\"" : "");
ss << "(which resolved to \"" << path << "\") ";
LOG(LogWarning) << ss.str();
} }
element.properties[node.name()] = path; element.properties[node.name()] = path;
break; break;

View file

@ -68,10 +68,9 @@ public:
inline void setFiles(const std::deque<std::string>& deque) inline void setFiles(const std::deque<std::string>& deque)
{ {
*this << "From theme \"" << deque.front() << "\"\n"; *this << "From theme \"" << deque.front() << "\"";
for (auto it = deque.cbegin() + 1; it != deque.cend(); it++) for (auto it = deque.cbegin() + 1; it != deque.cend(); it++)
*this << " (from included file \"" << (*it) << "\")\n"; *this << " (from included file \"" << (*it) << "\")\n";
*this << " ";
} }
}; };