From f4cfcbed65e7387d9868c193f6b8335827b2a1fa Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 1 Jan 2021 18:36:53 +0100 Subject: [PATCH] Some improvements to the application logging. --- es-app/src/Gamelist.cpp | 7 +++---- es-core/src/ThemeData.cpp | 8 +++----- es-core/src/ThemeData.h | 3 +-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/es-app/src/Gamelist.cpp b/es-app/src/Gamelist.cpp index 6315f1ccb..a6ac09202 100644 --- a/es-app/src/Gamelist.cpp +++ b/es-app/src/Gamelist.cpp @@ -50,7 +50,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType return treeNode; 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; } @@ -66,7 +66,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType // 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 (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; } @@ -144,8 +144,7 @@ void parseGamelist(SystemData* system) FileData* file = findOrCreateFile(system, path, type); if (!file) { - LOG(LogError) << "Error finding/creating FileData for \"" << - path << "\", skipping entry"; + LOG(LogError) << "Could not find or create \"" << path << "\", skipping entry"; continue; } else if (!file->isArcadeAsset()) { diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 60b765922..624d701ea 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -490,11 +490,9 @@ void ThemeData::parseElement(const pugi::xml_node& root, if (!ResourceManager::getInstance()->fileExists(path)) { std::stringstream ss; // "From theme yadda yadda, included file yadda yadda. - ss << " Warning " << error.msg; - ss << "could not find file \"" << node.text().get() << "\" "; - if (node.text().get() != path) - ss << "(which resolved to \"" << path << "\") "; - LOG(LogWarning) << ss.str(); + LOG(LogWarning) << error.msg << ":"; + LOG(LogWarning) << "Could not find file \"" << node.text().get() << "\" " << + ((node.text().get() != path) ? "which resolves to \"" + path + "\"" : ""); } element.properties[node.name()] = path; break; diff --git a/es-core/src/ThemeData.h b/es-core/src/ThemeData.h index 3bc05c77a..cbc14eb82 100644 --- a/es-core/src/ThemeData.h +++ b/es-core/src/ThemeData.h @@ -68,10 +68,9 @@ public: inline void setFiles(const std::deque& deque) { - *this << "From theme \"" << deque.front() << "\"\n"; + *this << "From theme \"" << deque.front() << "\""; for (auto it = deque.cbegin() + 1; it != deque.cend(); it++) *this << " (from included file \"" << (*it) << "\")\n"; - *this << " "; } };