[APP] Limit logging SPA properties
Fixed Cracdown logging large tabulate table causing garbage text in the log.
This commit is contained in:
@@ -1581,12 +1581,16 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
|
||||
const std::vector<kernel::util::GameInfoDatabase::Property>
|
||||
properties_list = game_info_database_->GetProperties();
|
||||
|
||||
// 4D5307DC SPA contains a lot of properties, limit properties to log.
|
||||
const auto properties_list_limit =
|
||||
properties_list | std::views::take(150);
|
||||
|
||||
table = tabulate::Table();
|
||||
table.format().multi_byte_characters(true);
|
||||
table.add_row({"ID", "Name", "Matchmaking", "Data Size"});
|
||||
|
||||
for (const kernel::util::GameInfoDatabase::Property& entry :
|
||||
properties_list) {
|
||||
properties_list_limit) {
|
||||
std::string label =
|
||||
string_util::remove_eol(string_util::trim(entry.description));
|
||||
|
||||
@@ -1594,8 +1598,17 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
|
||||
entry.is_matchmaking ? "True" : "False",
|
||||
fmt::format("{}", entry.data_size)});
|
||||
}
|
||||
XELOGI("\n-------------------- PROPERTIES --------------------\n{}",
|
||||
table.str());
|
||||
|
||||
std::string properties_totals;
|
||||
|
||||
if (properties_list.size() > properties_list_limit.size()) {
|
||||
properties_totals =
|
||||
fmt::format("\nProperties: {}/{}", properties_list_limit.size(),
|
||||
properties_list.size());
|
||||
}
|
||||
|
||||
XELOGI("\n-------------------- PROPERTIES --------------------{}\n{}",
|
||||
properties_totals.c_str(), table.str());
|
||||
|
||||
const std::vector<kernel::util::GameInfoDatabase::Context> contexts_list =
|
||||
game_info_database_->GetContexts();
|
||||
@@ -1645,14 +1658,14 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
|
||||
entry.view.online_only ? "True" : "False"});
|
||||
}
|
||||
|
||||
std::string totals;
|
||||
std::string stats_view_totals;
|
||||
|
||||
if (stats_views.size() > stats_views_limit.size()) {
|
||||
totals = fmt::format("\nViews: {}/{}", stats_views_limit.size(),
|
||||
stats_views.size());
|
||||
stats_view_totals = fmt::format(
|
||||
"\nViews: {}/{}", stats_views_limit.size(), stats_views.size());
|
||||
}
|
||||
XELOGI("\n-------------------- Stats Views --------------------{}\n{}",
|
||||
totals.c_str(), table.str());
|
||||
XELOGI("\n-------------------- STATS VIEWS --------------------{}\n{}",
|
||||
stats_view_totals.c_str(), table.str());
|
||||
|
||||
const std::vector<kernel::util::GameInfoDatabase::PresenceMode>
|
||||
presence_modes = game_info_database_->GetPresenceModes();
|
||||
|
||||
Reference in New Issue
Block a user