refactor(log): migra els subsistemes restants i elimina iostream
Acaba la migració dels std::cout/cerr a Log::*:
- core/locale, core/ui/ui_config, core/rendering/{screen,text,gif,
surface, sprite/animated_sprite, sdl3gpu/*}.
- game/{options, debug_config, editor/editor_config, levels/level_manager,
map/{map,tilemap,paint_layer}, entities/entity_manager_loadlevel}.
Severitats coherents: warns per a configs absents amb fallback,
errors per a YAML malformat o E/S fallida, infos per a estats.
Resultat:
- 0 occurrences de std::cout/std::cerr a source/.
- Cap #include <iostream> orfà (eliminat de surface.cpp).
- Output funcional idèntic al històric; AEE_LOG filtra (ex.
`AEE_LOG=warn` només mostra warnings, `AEE_LOG=*:warn,Tag:info`
combina globals i overrides).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5fce52e0ad
commit
c8882a3f6e
17 files changed
+83
-101
No files matched your search
@@ -3,13 +3,13 @@
|
||||
#ifdef _DEBUG
|
||||
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
#include "core/resources/resource_helper.hpp"
|
||||
#include "external/fkyaml_node.hpp"
|
||||
#include "utils/defaults.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace {
|
||||
if (!s.empty() && s.front() == '#') { s.erase(0, 1); }
|
||||
dst = static_cast<std::uint32_t>(std::stoul(s, nullptr, 0));
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "EditorConfig: color '" << key << "' invàlid (" << e.what() << ") — ignorat\n";
|
||||
Log::warn("EditorConfig", "color '{}' invàlid ({}) — ignorat", key, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ auto EditorConfig::get() -> EditorConfig& {
|
||||
void EditorConfig::load(const std::string& file_path) {
|
||||
auto bytes = Resource::Helper::loadFile(file_path);
|
||||
if (bytes.empty()) {
|
||||
std::cerr << "EditorConfig: no s'ha pogut obrir " << file_path << " — s'usaran els defaults compilats\n";
|
||||
Log::warn("EditorConfig", "no s'ha pogut obrir {} — s'usaran els defaults compilats", file_path);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -76,9 +76,9 @@ void EditorConfig::load(const std::string& file_path) {
|
||||
readArgb(c, "picker_hover", picker_hover_argb_);
|
||||
}
|
||||
|
||||
std::cout << "EditorConfig: carregat des de " << file_path << '\n';
|
||||
Log::info("EditorConfig", "carregat des de {}", file_path);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "EditorConfig: error parsejant " << file_path << ": " << e.what() << '\n';
|
||||
Log::error("EditorConfig", "error parsejant {}: {}", file_path, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user