afegit el namespace Logger

This commit is contained in:
2025-10-19 18:10:55 +02:00
parent df6e7e5155
commit 413c3c30a6
17 changed files with 107 additions and 96 deletions

View File

@@ -49,7 +49,6 @@ void Asset::add(const std::string& file_path, Type type, bool required, bool abs
addToMap(file_path, type, required, absolute);
}
// Carga recursos desde un archivo de configuración con soporte para variables
// Carga recursos desde un archivo de configuración con soporte para variables
void Asset::loadFromFile(const std::string& config_file_path, const std::string& prefix, const std::string& system_folder) {
std::ifstream file(config_file_path);
@@ -125,10 +124,7 @@ void Asset::loadFromFile(const std::string& config_file_path, const std::string&
}
}
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Loaded %d assets from config file",
static_cast<int>(file_list_.size()));
std::cout << "Loaded " << file_list_.size() << " assets from config file" << std::endl;
file.close();
}
@@ -180,9 +176,7 @@ auto Asset::check() const -> bool {
Type asset_type = static_cast<Type>(type);
if (by_type.find(asset_type) != by_type.end()) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"\n>> %s FILES",
getTypeName(asset_type).c_str());
Logger::info(getTypeName(asset_type) + " FILES");
bool type_success = true;
for (const auto* item : by_type[asset_type]) {
@@ -193,18 +187,10 @@ auto Asset::check() const -> bool {
}
if (type_success) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, " All files are OK.");
Logger::info("All files are OK.\n");
}
}
}
// Resultado
if (success) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n** CHECKING FILES COMPLETED.\n");
} else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "\n** CHECKING FILES FAILED.\n");
}
return success;
}