From b5485b4ca97667b8e58f61049763cbd92131ab33 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Jul 2020 23:30:45 +0200 Subject: [PATCH] Changed log levels from numbers to text. --- THEMES.md | 8 ++++---- es-app/src/CollectionSystemManager.cpp | 2 +- es-app/src/FileData.cpp | 4 ++-- es-app/src/Gamelist.cpp | 2 +- es-app/src/SystemData.cpp | 20 +++++++++---------- es-app/src/main.cpp | 6 +++--- es-app/src/scrapers/GamesDBJSONScraper.cpp | 14 ++++++------- .../scrapers/GamesDBJSONScraperResources.cpp | 4 ++-- es-app/src/scrapers/Scraper.cpp | 16 +++++++-------- es-app/src/scrapers/ScreenScraper.cpp | 4 ++-- es-core/src/AudioManager.cpp | 4 ++-- es-core/src/ImageIO.cpp | 4 ++-- es-core/src/InputConfig.cpp | 4 ++-- es-core/src/InputManager.cpp | 6 +++--- es-core/src/Log.cpp | 2 +- es-core/src/Log.h | 8 ++++++++ es-core/src/Platform.cpp | 8 ++++---- es-core/src/Settings.cpp | 4 ++-- es-core/src/Sound.cpp | 2 +- es-core/src/resources/ResourceManager.cpp | 2 +- es-core/src/utils/FileSystemUtil.cpp | 18 ++++++++--------- 21 files changed, 73 insertions(+), 69 deletions(-) diff --git a/THEMES.md b/THEMES.md index 259d67187..a1ab841f0 100644 --- a/THEMES.md +++ b/THEMES.md @@ -286,10 +286,10 @@ Starting EmulationStation with the --debug flag will provide feedback on whether Example debug output: ``` -Jul 12 11:28:58 lvl3: Sound::getFromTheme(): Looking for navigation sound tag . -Jul 12 11:28:58 lvl3: Sound::getFromTheme(): Tag found, ready to load theme sound file. -Jul 12 11:28:58 lvl3: Sound::getFromTheme(): Looking for navigation sound tag . -Jul 12 11:28:58 lvl3: Sound::getFromTheme(): Tag not found, using fallback sound file. +Jul 12 11:28:58 Debug: Sound::getFromTheme(): Looking for navigation sound tag . +Jul 12 11:28:58 Debug: Sound::getFromTheme(): Tag found, ready to load theme sound file. +Jul 12 11:28:58 Debug: Sound::getFromTheme(): Looking for navigation sound tag . +Jul 12 11:28:58 Debug: Sound::getFromTheme(): Tag not found, using fallback sound file. ``` diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index 680062fb0..44fc728e4 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -148,7 +148,7 @@ void CollectionSystemManager::saveCustomCollection(SystemData* sys) } } else { - LOG(LogError) << "Error - Couldn't find collection to save! " << name; + LOG(LogError) << "Couldn't find collection to save! " << name; } } diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 02c57b912..788c13e48 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -379,7 +379,7 @@ void FileData::sort(ComparisonFunction& comparator, bool ascending) std::vector mChildrenShown; for (unsigned int i = 0; i < mChildren.size(); i++) { if (mChildren[i]->getHidden()) { - LOG(LogDebug) << "Debug - FileData::sort(): Skipping hidden game '" << + LOG(LogDebug) << "FileData::sort(): Skipping hidden game '" << mChildren[i]->getName() << "'"; continue; } @@ -420,7 +420,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator, bool ascending for (unsigned int i = 0; i < mChildren.size(); i++) { // Exclude game if it's marked as hidden and the hide setting has been set. if (!showHiddenGames && mChildren[i]->getHidden()) { - LOG(LogDebug) << "Debug - FileData::sortFavoritesOnTop(): Skipping hidden game '" << + LOG(LogDebug) << "FileData::sortFavoritesOnTop(): Skipping hidden game '" << mChildren[i]->getName() << "'"; continue; } diff --git a/es-app/src/Gamelist.cpp b/es-app/src/Gamelist.cpp index 0a3739f77..0fa05c47b 100644 --- a/es-app/src/Gamelist.cpp +++ b/es-app/src/Gamelist.cpp @@ -128,7 +128,7 @@ void parseGamelist(SystemData* system) relativeTo, false); if (!trustGamelist && !Utils::FileSystem::exists(path)) { - LOG(LogWarning) << "Warning - File \"" << path << "\" does not exist, ignoring."; + LOG(LogWarning) << "File \"" << path << "\" does not exist, ignoring."; continue; } diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 01bb0976c..f472c6412 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -101,8 +101,8 @@ bool SystemData::populateFolder(FileData* folder) return false; } if (!Utils::FileSystem::isDirectory(folderPath)) { - LOG(LogWarning) << "Warning - Folder with path \"" << - folderPath << "\" is not a directory!"; + LOG(LogWarning) << "Folder with path \"" << + folderPath << "\" is not a directory."; return false; } @@ -111,7 +111,7 @@ bool SystemData::populateFolder(FileData* folder) // If this symlink resolves to somewhere that's at the beginning of our // path, it's going to create a recursive loop. Make sure to avoid this. if (folderPath.find(Utils::FileSystem::getCanonicalPath(folderPath)) == 0) { - LOG(LogWarning) << "Warning - Skipping infinitely recursive symlink \"" << + LOG(LogWarning) << "Skipping infinitely recursive symlink \"" << folderPath << "\""; return false; } @@ -219,7 +219,7 @@ bool SystemData::loadConfig() LOG(LogInfo) << "Loading system config file " << path << "..."; if (!Utils::FileSystem::exists(path)) { - LOG(LogWarning) << "Warning - es_systems.cfg does not exist."; + LOG(LogWarning) << "es_systems.cfg does not exist."; if (copyConfigTemplate(getConfigPath(true))) return false; path = getConfigPath(false); @@ -233,7 +233,7 @@ bool SystemData::loadConfig() #endif if (!res) { - LOG(LogError) << "Error - Could not parse es_systems.cfg"; + LOG(LogError) << "Could not parse es_systems.cfg"; LOG(LogError) << res.description(); return false; } @@ -242,7 +242,7 @@ bool SystemData::loadConfig() pugi::xml_node systemList = doc.child("systemList"); if (!systemList) { - LOG(LogError) << "Error - es_systems.cfg is missing the tag!"; + LOG(LogError) << "es_systems.cfg is missing the tag."; return false; } @@ -288,7 +288,7 @@ bool SystemData::loadConfig() // If there appears to be an actual platform ID supplied // but it didn't match the list, generate a warning. if (str != nullptr && str[0] != '\0' && platformId == PlatformIds::PLATFORM_UNKNOWN) - LOG(LogWarning) << "Warning - Unknown platform for system \"" << name << + LOG(LogWarning) << "Unknown platform for system \"" << name << "\" (platform \"" << str << "\" from list \"" << platformList << "\")"; else if (platformId != PlatformIds::PLATFORM_UNKNOWN) platformIds.push_back(platformId); @@ -299,8 +299,8 @@ bool SystemData::loadConfig() // Validate. if (name.empty() || path.empty() || extensions.empty() || cmd.empty()) { - LOG(LogError) << "Error - System \"" << name << - "\" is missing name, path, extension, or command!"; + LOG(LogError) << "System \"" << name << + "\" is missing name, path, extension, or command."; continue; } @@ -363,7 +363,7 @@ bool SystemData::copyConfigTemplate(const std::string& path) #endif if (Utils::FileSystem::copyFile(systemsTemplateFile, path, false)) { - LOG(LogError) << "Error - Copying of es_systems.cfg template file failed."; + LOG(LogError) << "Copying of es_systems.cfg template file failed."; return true; } diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 0071ed265..cbb074f5b 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -347,7 +347,7 @@ bool verifyHomeFolderExists() bool loadSystemConfigFile(std::string& errorMsg) { if (!SystemData::loadConfig()) { - LOG(LogError) << "Error - Could not parse systems configuration file."; + LOG(LogError) << "Could not parse systems configuration file."; errorMsg = "COULDN'T FIND THE SYSTEMS CONFIGURATION FILE.\n" "ATTEMPTED TO COPY A TEMPLATE ES_SYSTEMS.CFG FILE\n" "FROM THE EMULATIONSTATION RESOURCES DIRECTORY,\n" @@ -358,7 +358,7 @@ bool loadSystemConfigFile(std::string& errorMsg) } if (SystemData::sSystemVector.size() == 0) { - LOG(LogError) << "Error - No systems found, does at least one system have a game present? " + LOG(LogError) << "No systems found, does at least one system have a game present? " "(Check that the file extensions are supported.)"; errorMsg = "THE SYSTEMS CONFIGURATION FILE EXISTS, BUT NO\n" "GAME FILES WERE FOUND. PLEASE MAKE SURE THAT\n" @@ -534,7 +534,7 @@ int main(int argc, char* argv[]) // Check if the media directory exists, and if not, log a warning. if (!Utils::FileSystem::isDirectory(FileData::getMediaDirectory()) || Utils::FileSystem::isSymlink(FileData::getMediaDirectory())) { - LOG(LogWarning) << "Warning - Games media directory does not exist " + LOG(LogWarning) << "Games media directory does not exist " "(or is not a directory or a symlink):"; LOG(LogWarning) << FileData::getMediaDirectory(); } diff --git a/es-app/src/scrapers/GamesDBJSONScraper.cpp b/es-app/src/scrapers/GamesDBJSONScraper.cpp index ca5306a63..518cf1c80 100644 --- a/es-app/src/scrapers/GamesDBJSONScraper.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraper.cpp @@ -161,7 +161,7 @@ void thegamesdb_generate_json_scraper_requests( first = false; } else { - LOG(LogWarning) << "Warning - TheGamesDB scraper warning - " + LOG(LogWarning) << "TheGamesDB scraper warning - " "no support for platform " << getPlatformName(*platformIt); } } @@ -380,7 +380,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, if (doc.HasParseError()) { std::string err = - std::string("Error - TheGamesDBJSONRequest - Error parsing JSON. \n\t") + + std::string("TheGamesDBJSONRequest - Error parsing JSON. \n\t") + GetParseError_En(doc.GetParseError()); setError(err); LOG(LogError) << err; @@ -399,8 +399,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, baseImageUrlLarge = base_url["large"].GetString(); } else { - std::string warn = "Warning - TheGamesDBJSONRequest - No URL path for large images.\n"; - LOG(LogWarning) << warn; + LOG(LogWarning) << "TheGamesDBJSONRequest - No URL path for large images.\n"; return; } @@ -408,7 +407,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, processMediaURLs(images, baseImageUrlLarge, results); } catch (std::runtime_error& e) { - LOG(LogError) << "Error - Error while processing media URLs: " << e.what(); + LOG(LogError) << "Error while processing media URLs: " << e.what(); } // Find how many more requests we can make before the scraper @@ -427,8 +426,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, // These process steps are for the initial scraping response. if (!doc.HasMember("data") || !doc["data"].HasMember("games") || !doc["data"]["games"].IsArray()) { - std::string warn = "Warning - TheGamesDBJSONRequest - Response had no game data.\n"; - LOG(LogWarning) << warn; + LOG(LogWarning) << "TheGamesDBJSONRequest - Response had no game data.\n"; return; } @@ -441,7 +439,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, processGame(v, results); } catch (std::runtime_error& e) { - LOG(LogError) << "Error - Error while processing game: " << e.what(); + LOG(LogError) << "Error while processing game: " << e.what(); } } } diff --git a/es-app/src/scrapers/GamesDBJSONScraperResources.cpp b/es-app/src/scrapers/GamesDBJSONScraperResources.cpp index 4f00c02a5..29593b76a 100644 --- a/es-app/src/scrapers/GamesDBJSONScraperResources.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraperResources.cpp @@ -125,14 +125,14 @@ bool TheGamesDBJSONRequestResources::saveResource( { if (req == nullptr) { - LOG(LogError) << "Error - HTTP request pointer was null.\n"; + LOG(LogError) << "HTTP request pointer was null.\n"; return true; } if (req->status() == HttpReq::REQ_IN_PROGRESS) { return false; // Not ready: wait some more. } if (req->status() != HttpReq::REQ_SUCCESS) { - LOG(LogError) << "Error - Resource request for " << file_name << + LOG(LogError) << "Resource request for " << file_name << " failed:\n\t" << req->getErrorMsg(); return true; // Request failed, resetting request.. } diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp index 14acd9202..e67241e9f 100644 --- a/es-app/src/scrapers/Scraper.cpp +++ b/es-app/src/scrapers/Scraper.cpp @@ -31,8 +31,7 @@ std::unique_ptr startScraperSearch(const ScraperSearchParam // Check if the scraper in the settings still exists as a registered scraping source. if (scraper_request_funcs.find(name) == scraper_request_funcs.end()) - LOG(LogWarning) << "Warning - Configured scraper (" << name << - ") unavailable, scraping aborted."; + LOG(LogWarning) << "Configured scraper (" << name << ") unavailable, scraping aborted."; else scraper_request_funcs.at(name)(params, handle->mRequestQueue, handle->mResults); @@ -47,8 +46,7 @@ std::unique_ptr startMediaURLsFetch(const std::string& game ScraperSearchParams params; // Check if the scraper in the settings still exists as a registered scraping source. if (scraper_request_funcs.find(name) == scraper_request_funcs.end()) { - LOG(LogWarning) << "Warning - Configured scraper (" << name << - ") unavailable, scraping aborted."; + LOG(LogWarning) << "Configured scraper (" << name << ") unavailable, scraping aborted."; } else { // Specifically use the TheGamesDB function as this type of request @@ -145,7 +143,7 @@ void ScraperHttpRequest::update() return; // Everything else is some sort of error. - LOG(LogError) << "Error - ScraperHttpRequest network error (status: " << status<< ") - " + LOG(LogError) << "ScraperHttpRequest network error (status: " << status<< ") - " << mReq->getErrorMsg(); setError(mReq->getErrorMsg()); } @@ -407,7 +405,7 @@ bool resizeImage(const std::string& path, int maxWidth, int maxHeight) if (format == FIF_UNKNOWN) format = FreeImage_GetFIFFromFilename(path.c_str()); if (format == FIF_UNKNOWN) { - LOG(LogError) << "Error - Could not detect filetype for image \"" << path << "\"!"; + LOG(LogError) << "Could not detect filetype for image \"" << path << "\"!"; return false; } @@ -416,7 +414,7 @@ bool resizeImage(const std::string& path, int maxWidth, int maxHeight) image = FreeImage_Load(format, path.c_str()); } else { - LOG(LogError) << "Error - File format not supported for image \"" << path << "\"!"; + LOG(LogError) << "File format not supported for image \"" << path << "\"!"; return false; } @@ -437,7 +435,7 @@ bool resizeImage(const std::string& path, int maxWidth, int maxHeight) FreeImage_Unload(image); if (imageRescaled == nullptr) { - LOG(LogError) << "Error - Could not resize image! (not enough memory? invalid bitdepth?)"; + LOG(LogError) << "Could not resize image. (Not enough memory? Invalid bitdepth?)"; return false; } @@ -445,7 +443,7 @@ bool resizeImage(const std::string& path, int maxWidth, int maxHeight) FreeImage_Unload(imageRescaled); if (!saved) { - LOG(LogError) << "Error - Failed to save resized image!"; + LOG(LogError) << "Failed to save resized image."; } return saved; diff --git a/es-app/src/scrapers/ScreenScraper.cpp b/es-app/src/scrapers/ScreenScraper.cpp index b10eef1d7..4a8b984ce 100644 --- a/es-app/src/scrapers/ScreenScraper.cpp +++ b/es-app/src/scrapers/ScreenScraper.cpp @@ -149,7 +149,7 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params, p_ids.push_back(mapIt->second); } else { - LOG(LogWarning) << "Warning - ScreenScraper: no support for platform " << + LOG(LogWarning) << "ScreenScraper: no support for platform " << getPlatformName(*platformIt); // Add the scrape request without a platform/system ID. requests.push(std::unique_ptr @@ -180,7 +180,7 @@ void ScreenScraperRequest::process(const std::unique_ptr& req, if (!parseResult) { std::stringstream ss; - ss << "Error - ScreenScraperRequest - Error parsing XML: " << parseResult.description(); + ss << "ScreenScraperRequest - Error parsing XML: " << parseResult.description(); std::string err = ss.str(); setError(err); diff --git a/es-core/src/AudioManager.cpp b/es-core/src/AudioManager.cpp index e6826eb02..fb4571945 100644 --- a/es-core/src/AudioManager.cpp +++ b/es-core/src/AudioManager.cpp @@ -102,7 +102,7 @@ void AudioManager::init() // Open the audio device and pause. if (SDL_OpenAudio(&sAudioFormat, nullptr) < 0) { - LOG(LogError) << "AudioManager Error - Unable to open SDL audio: " << + LOG(LogError) << "AudioManager - Unable to open SDL audio: " << SDL_GetError() << std::endl; } } @@ -134,7 +134,7 @@ void AudioManager::unregisterSound(std::shared_ptr & sound) return; } } - LOG(LogError) << "AudioManager Error - tried to unregister a sound that wasn't registered!"; + LOG(LogError) << "AudioManager - tried to unregister a sound that wasn't registered!"; } void AudioManager::play() diff --git a/es-core/src/ImageIO.cpp b/es-core/src/ImageIO.cpp index 5d3b8b764..8e5742899 100644 --- a/es-core/src/ImageIO.cpp +++ b/es-core/src/ImageIO.cpp @@ -61,11 +61,11 @@ std::vector ImageIO::loadFromMemoryRGBA32(const unsigned char * d } } else { - LOG(LogError) << "Error - Failed to load image from memory!"; + LOG(LogError) << "Failed to load image from memory!"; } } else { - LOG(LogError) << "Error - Couldn't load image, file is missing or the file type is " << + LOG(LogError) << "Couldn't load image, file is missing or the file type is " << // it's not existing or the file type " << (format == FIF_UNKNOWN ? "unknown" : "unsupported") << "!"; } diff --git a/es-core/src/InputConfig.cpp b/es-core/src/InputConfig.cpp index 960cb8544..6e55bd5ad 100644 --- a/es-core/src/InputConfig.cpp +++ b/es-core/src/InputConfig.cpp @@ -196,7 +196,7 @@ void InputConfig::loadFromXML(pugi::xml_node& node) InputType typeEnum = stringToInputType(type); if (typeEnum == TYPE_COUNT) { - LOG(LogError) << "Error - InputConfig load error - input of type \"" << type << + LOG(LogError) << "InputConfig load error - input of type \"" << type << "\" is invalid! Skipping input \"" << name << "\".\n"; continue; } @@ -205,7 +205,7 @@ void InputConfig::loadFromXML(pugi::xml_node& node) int value = input.attribute("value").as_int(); if (value == 0) { - LOG(LogWarning) << "Warning - InputConfig value is 0 for " << + LOG(LogWarning) << "InputConfig value is 0 for " << type << " " << id << "!\n"; } diff --git a/es-core/src/InputManager.cpp b/es-core/src/InputManager.cpp index 765449617..a4f29bcf6 100644 --- a/es-core/src/InputManager.cpp +++ b/es-core/src/InputManager.cpp @@ -142,7 +142,7 @@ void InputManager::removeJoystickByJoystickID(SDL_JoystickID joyId) mJoysticks.erase(joyIt); } else { - LOG(LogError) << "Error - Could not find joystick to close (instance ID: " << joyId << ")"; + LOG(LogError) << "Could not find joystick to close (instance ID: " << joyId << ")"; } } @@ -472,7 +472,7 @@ void InputManager::doOnFinish() #endif if (!result) { - LOG(LogError) << "Error - Couldn't parse input config: " << result.description(); + LOG(LogError) << "Couldn't parse input config: " << result.description(); } else { pugi::xml_node root = doc.child("inputList"); @@ -546,7 +546,7 @@ std::string InputManager::getDeviceGUIDString(int deviceId) auto it = mJoysticks.find(deviceId); if (it == mJoysticks.cend()) { - LOG(LogError) << "Error - getDeviceGUIDString - deviceId " << deviceId << " not found!"; + LOG(LogError) << "getDeviceGUIDString - deviceId " << deviceId << " not found!"; return "something went horribly wrong"; } diff --git a/es-core/src/Log.cpp b/es-core/src/Log.cpp index cc6183bac..d40cfb8b6 100644 --- a/es-core/src/Log.cpp +++ b/es-core/src/Log.cpp @@ -52,7 +52,7 @@ void Log::open() std::ostringstream& Log::get(LogLevel level) { time_t t = time(nullptr); - os << std::put_time(localtime(&t), "%b %d %T ") << "lvl" << level << ": \t"; + os << std::put_time(localtime(&t), "%b %d %T ") << logLevelMap[level] << ":\t"; messageLevel = level; return os; diff --git a/es-core/src/Log.h b/es-core/src/Log.h index 5b5c6358c..b100c4a05 100644 --- a/es-core/src/Log.h +++ b/es-core/src/Log.h @@ -9,6 +9,7 @@ #define ES_CORE_LOG_H #include +#include #define LOG(level) \ if (level > Log::getReportingLevel()); \ @@ -41,6 +42,13 @@ protected: std::ostringstream os; private: + std::map logLevelMap { + { LogError, "Error" }, + { LogWarning, "Warn" }, + { LogInfo, "Info" }, + { LogDebug, "Debug" } + }; + static LogLevel reportingLevel; LogLevel messageLevel; }; diff --git a/es-core/src/Platform.cpp b/es-core/src/Platform.cpp index 939e9bbcd..e5b0fa131 100644 --- a/es-core/src/Platform.cpp +++ b/es-core/src/Platform.cpp @@ -78,7 +78,7 @@ int launchEmulatorUnix(const std::string& cmd_utf8) int returnValue; if (!(commandPipe = (FILE*)popen(command.c_str(), "r"))) { - LOG(LogError) << "Error - couldn't open pipe to command."; + LOG(LogError) << "Couldn't open pipe to command."; return -1; } @@ -97,7 +97,7 @@ int launchEmulatorUnix(const std::string& cmd_utf8) } if (returnValue) { - LOG(LogError) << "Error - launchEmulatorUnix - return value " << + LOG(LogError) << "launchEmulatorUnix - return value " << std::to_string(returnValue) + ":"; if (commandOutput.size()) LOG(LogError) << commandOutput; @@ -170,7 +170,7 @@ int launchEmulatorWindows(const std::wstring& cmd_utf16) } } - LOG(LogError) << "Error - launchEmulatorWindows - system error code " << + LOG(LogError) << "launchEmulatorWindows - system error code " << errorCode << ": " << errorMessage; } @@ -230,7 +230,7 @@ int quitES(QuitMode mode) void emergencyShutdown() { - LOG(LogError) << "Critical Error - Performing emergency shutdown..."; + LOG(LogError) << "Critical - Performing emergency shutdown..."; MameNames::deinit(); AudioManager::getInstance()->deinit(); diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index bc8d3f20c..757dcb253 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -306,7 +306,7 @@ void Settings::loadFile() pugi::xml_parse_result result = doc.load_file(path.c_str()); #endif if (!result) { - LOG(LogError) << "Error - Could not parse Settings file!\n " << result.description(); + LOG(LogError) << "Could not parse Settings file.\n " << result.description(); return; } @@ -326,7 +326,7 @@ void Settings::loadFile() type Settings::getMethodName(const std::string& name) \ { \ if (mapName.find(name) == mapName.cend()) { \ - LOG(LogError) << "Error - Tried to use unset setting " << name << "!"; \ + LOG(LogError) << "Tried to use unset setting " << name << "!"; \ } \ return mapName[name]; \ } \ diff --git a/es-core/src/Sound.cpp b/es-core/src/Sound.cpp index 2acd5e3b4..eb6355e04 100644 --- a/es-core/src/Sound.cpp +++ b/es-core/src/Sound.cpp @@ -117,7 +117,7 @@ void Sound::init() Uint8 * data = nullptr; Uint32 dlen = 0; if (SDL_LoadWAV(mPath.c_str(), &wave, &data, &dlen) == nullptr) { - LOG(LogError) << "Error - Failed to load theme navigation sound file:"; + LOG(LogError) << "Failed to load theme navigation sound file:"; LOG(LogError) << SDL_GetError(); return; } diff --git a/es-core/src/resources/ResourceManager.cpp b/es-core/src/resources/ResourceManager.cpp index a91eedd55..7cd3efdec 100644 --- a/es-core/src/resources/ResourceManager.cpp +++ b/es-core/src/resources/ResourceManager.cpp @@ -67,7 +67,7 @@ std::string ResourceManager::getResourcePath(const std::string& path) const // For missing resources, log an error and terminate the application. This should // indicate that we have a broken EmulationStation installation. else { - LOG(LogError) << "Error - Program resource missing: " << path; + LOG(LogError) << "Program resource missing: " << path; LOG(LogError) << "Tried to find the resource in the following locations:"; LOG(LogError) << testHome; #ifdef __unix__ diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index 4bf94c034..1736b2249 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -544,19 +544,19 @@ namespace Utils const std::string& _destination_path, bool _overwrite) { if (!exists(_source_path)) { - LOG(LogError) << "Error - Can't copy file, source file does not exist:"; + LOG(LogError) << "Can't copy file, source file does not exist:"; LOG(LogError) << _source_path; return true; } if (isDirectory(_destination_path)) { - LOG(LogError) << "Error - Destination file is actually a directory:"; + LOG(LogError) << "Destination file is actually a directory:"; LOG(LogError) << _destination_path; return true; } if (!_overwrite && exists(_destination_path)) { - LOG(LogError) << "Error - Destination file exists and the overwrite flag " + LOG(LogError) << "Destination file exists and the overwrite flag " "has not been set."; return true; } @@ -569,7 +569,7 @@ namespace Utils #endif if (sourceFile.fail()) { - LOG(LogError) << "Error - Couldn't read from source file (" << _source_path << + LOG(LogError) << "Couldn't read from source file (" << _source_path << "), permission problems?"; sourceFile.close(); return true; @@ -583,7 +583,7 @@ namespace Utils #endif if (targetFile.fail()) { - LOG(LogError) << "Error - Couldn't write to target file (" << _destination_path << + LOG(LogError) << "Couldn't write to target file (" << _destination_path << "), permission problems?"; targetFile.close(); return true; @@ -608,13 +608,13 @@ namespace Utils } if (isDirectory(_destination_path)) { - LOG(LogError) << "Error - Destination file is actually a directory:"; + LOG(LogError) << "Destination file is actually a directory:"; LOG(LogError) << _destination_path; return true; } if (!_overwrite && exists(_destination_path)) { - LOG(LogError) << "Error - Destination file exists and the overwrite flag " + LOG(LogError) << "Destination file exists and the overwrite flag " "has not been set."; return true; } @@ -640,7 +640,7 @@ namespace Utils // Try to remove file. #ifdef _WIN64 if (_wunlink(Utils::String::stringToWideString(path).c_str()) != 0) { - LOG(LogError) << "Error - Couldn't delete file, permission problems?"; + LOG(LogError) << "Couldn't delete file, permission problems?"; LOG(LogError) << path; return true; } @@ -649,7 +649,7 @@ namespace Utils } #else if (unlink(path.c_str()) != 0) { - LOG(LogError) << "Error - Couldn't delete file, permission problems?"; + LOG(LogError) << "Couldn't delete file, permission problems?"; LOG(LogError) << path; return true; }