Skip to content

Commit

Permalink
Logging: Adjust the formatting to be more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
kamfretoz authored and F0bes committed Dec 28, 2024
1 parent 2167d9e commit 424951e
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 102 deletions.
64 changes: 32 additions & 32 deletions pcsx2/Achievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ std::string Achievements::GetGameHash(const std::string& elf_path)
Error error;
if (!cdvdLoadElf(&elfo, elf_path, false, &error))
{
Console.Error(fmt::format("(Achievements) Failed to read ELF '{}' on disc: {}", elf_path, error.GetDescription()));
Console.Error(fmt::format("Achievements: Failed to read ELF '{}' on disc: {}", elf_path, error.GetDescription()));
return {};
}

Expand Down Expand Up @@ -441,7 +441,7 @@ bool Achievements::Initialize()
const std::string api_token = Host::GetBaseStringSettingValue("Achievements", "Token");
if (!username.empty() && !api_token.empty())
{
Console.WriteLn("(Achievements) Attempting login with user '%s'...", username.c_str());
Console.WriteLn("Achievements: Attempting login with user '%s'...", username.c_str());
s_login_request =
rc_client_begin_login_with_token(s_client, username.c_str(), api_token.c_str(), ClientLoginWithTokenCallback, nullptr);
}
Expand Down Expand Up @@ -608,7 +608,7 @@ void Achievements::EnsureCacheDirectoriesExist()

void Achievements::ClientMessageCallback(const char* message, const rc_client_t* client)
{
Console.WriteLn("(Achievements) %s", message);
Console.WriteLn("Achievements: %s", message);
}

uint32_t Achievements::ClientReadMemory(uint32_t address, uint8_t* buffer, uint32_t num_bytes, rc_client_t* client)
Expand Down Expand Up @@ -865,7 +865,7 @@ void Achievements::IdentifyGame(u32 disc_crc, u32 crc)
// bail out if we're not logged in, just save the hash
if (!IsLoggedInOrLoggingIn())
{
Console.WriteLn(Color_StrongYellow, "(Achievements) Skipping load game because we're not logged in.");
Console.WriteLn(Color_StrongYellow, "Achievements: Skipping load game because we're not logged in.");
DisableHardcoreMode();
return;
}
Expand Down Expand Up @@ -908,7 +908,7 @@ void Achievements::ClientLoadGameCallback(int result, const char* error_message,
if (result == RC_NO_GAME_LOADED)
{
// Unknown game.
Console.WriteLn(Color_StrongYellow, "(Achievements) Unknown game '%s', disabling achievements.", s_game_hash.c_str());
Console.WriteLn(Color_StrongYellow, "Achievements: Unknown game '%s', disabling achievements.", s_game_hash.c_str());
DisableHardcoreMode();
return;
}
Expand Down Expand Up @@ -1083,7 +1083,7 @@ void Achievements::HandleUnlockEvent(const rc_client_event_t* event)
const rc_client_achievement_t* cheevo = event->achievement;
pxAssert(cheevo);

Console.WriteLn("(Achievements) Achievement %s (%u) for game %u unlocked", cheevo->title, cheevo->id, s_game_id);
Console.WriteLn("Achievements: Achievement %s (%u) for game %u unlocked", cheevo->title, cheevo->id, s_game_id);
UpdateGameSummary();

if (EmuConfig.Achievements.Notifications)
Expand All @@ -1109,7 +1109,7 @@ void Achievements::HandleUnlockEvent(const rc_client_event_t* event)

void Achievements::HandleGameCompleteEvent(const rc_client_event_t* event)
{
Console.WriteLn("(Achievements) Game %u complete", s_game_id);
Console.WriteLn("Achievements: Game %u complete", s_game_id);
UpdateGameSummary();

if (EmuConfig.Achievements.Notifications)
Expand All @@ -1133,7 +1133,7 @@ void Achievements::HandleGameCompleteEvent(const rc_client_event_t* event)

void Achievements::HandleLeaderboardStartedEvent(const rc_client_event_t* event)
{
DevCon.WriteLn("(Achievements) Leaderboard %u (%s) started", event->leaderboard->id, event->leaderboard->title);
DevCon.WriteLn("Achievements: Leaderboard %u (%s) started", event->leaderboard->id, event->leaderboard->title);

if (EmuConfig.Achievements.LeaderboardNotifications)
{
Expand All @@ -1152,7 +1152,7 @@ void Achievements::HandleLeaderboardStartedEvent(const rc_client_event_t* event)

void Achievements::HandleLeaderboardFailedEvent(const rc_client_event_t* event)
{
DevCon.WriteLn("(Achievements) Leaderboard %u (%s) failed", event->leaderboard->id, event->leaderboard->title);
DevCon.WriteLn("Achievements: Leaderboard %u (%s) failed", event->leaderboard->id, event->leaderboard->title);

if (EmuConfig.Achievements.LeaderboardNotifications)
{
Expand All @@ -1171,7 +1171,7 @@ void Achievements::HandleLeaderboardFailedEvent(const rc_client_event_t* event)

void Achievements::HandleLeaderboardSubmittedEvent(const rc_client_event_t* event)
{
Console.WriteLn("(Achievements) Leaderboard %u (%s) submitted", event->leaderboard->id, event->leaderboard->title);
Console.WriteLn("Achievements: Leaderboard %u (%s) submitted", event->leaderboard->id, event->leaderboard->title);

if (EmuConfig.Achievements.LeaderboardNotifications)
{
Expand Down Expand Up @@ -1203,7 +1203,7 @@ void Achievements::HandleLeaderboardSubmittedEvent(const rc_client_event_t* even

void Achievements::HandleLeaderboardScoreboardEvent(const rc_client_event_t* event)
{
Console.WriteLn("(Achievements) Leaderboard %u scoreboard rank %u of %u", event->leaderboard_scoreboard->leaderboard_id,
Console.WriteLn("Achievements: Leaderboard %u scoreboard rank %u of %u", event->leaderboard_scoreboard->leaderboard_id,
event->leaderboard_scoreboard->new_rank, event->leaderboard_scoreboard->num_entries);

if (EmuConfig.Achievements.LeaderboardNotifications)
Expand Down Expand Up @@ -1234,7 +1234,7 @@ void Achievements::HandleLeaderboardScoreboardEvent(const rc_client_event_t* eve
void Achievements::HandleLeaderboardTrackerShowEvent(const rc_client_event_t* event)
{
DevCon.WriteLn(
"(Achievements) Showing leaderboard tracker: %u: %s", event->leaderboard_tracker->id, event->leaderboard_tracker->display);
"Achievements: Showing leaderboard tracker: %u: %s", event->leaderboard_tracker->id, event->leaderboard_tracker->display);

LeaderboardTrackerIndicator indicator;
indicator.tracker_id = event->leaderboard_tracker->id;
Expand All @@ -1251,7 +1251,7 @@ void Achievements::HandleLeaderboardTrackerHideEvent(const rc_client_event_t* ev
if (it == s_active_leaderboard_trackers.end())
return;

DevCon.WriteLn("(Achievements) Hiding leaderboard tracker: %u", id);
DevCon.WriteLn("Achievements: Hiding leaderboard tracker: %u", id);
it->active = false;
it->show_hide_time.Reset();
}
Expand All @@ -1265,7 +1265,7 @@ void Achievements::HandleLeaderboardTrackerUpdateEvent(const rc_client_event_t*
return;

DevCon.WriteLn(
"(Achievements) Updating leaderboard tracker: %u: %s", event->leaderboard_tracker->id, event->leaderboard_tracker->display);
"Achievements: Updating leaderboard tracker: %u: %s", event->leaderboard_tracker->id, event->leaderboard_tracker->display);

it->text = event->leaderboard_tracker->display;
it->active = true;
Expand All @@ -1288,7 +1288,7 @@ void Achievements::HandleAchievementChallengeIndicatorShowEvent(const rc_client_
indicator.active = true;
s_active_challenge_indicators.push_back(std::move(indicator));

DevCon.WriteLn("(Achievements) Show challenge indicator for %u (%s)", event->achievement->id, event->achievement->title);
DevCon.WriteLn("Achievements: Show challenge indicator for %u (%s)", event->achievement->id, event->achievement->title);
}

void Achievements::HandleAchievementChallengeIndicatorHideEvent(const rc_client_event_t* event)
Expand All @@ -1298,14 +1298,14 @@ void Achievements::HandleAchievementChallengeIndicatorHideEvent(const rc_client_
if (it == s_active_challenge_indicators.end())
return;

DevCon.WriteLn("(Achievements) Hide challenge indicator for %u (%s)", event->achievement->id, event->achievement->title);
DevCon.WriteLn("Achievements: Hide challenge indicator for %u (%s)", event->achievement->id, event->achievement->title);
it->show_hide_time.Reset();
it->active = false;
}

void Achievements::HandleAchievementProgressIndicatorShowEvent(const rc_client_event_t* event)
{
DevCon.WriteLn("(Achievements) Showing progress indicator: %u (%s): %s", event->achievement->id, event->achievement->title,
DevCon.WriteLn("Achievements: Showing progress indicator: %u (%s): %s", event->achievement->id, event->achievement->title,
event->achievement->measured_progress);

if (!s_active_progress_indicator.has_value())
Expand All @@ -1323,14 +1323,14 @@ void Achievements::HandleAchievementProgressIndicatorHideEvent(const rc_client_e
if (!s_active_progress_indicator.has_value())
return;

DevCon.WriteLn("(Achievements) Hiding progress indicator");
DevCon.WriteLn("Achievements: Hiding progress indicator");
s_active_progress_indicator->show_hide_time.Reset();
s_active_progress_indicator->active = false;
}

void Achievements::HandleAchievementProgressIndicatorUpdateEvent(const rc_client_event_t* event)
{
DevCon.WriteLn("(Achievements) Updating progress indicator: %u (%s): %s", event->achievement->id, event->achievement->title,
DevCon.WriteLn("Achievements: Updating progress indicator: %u (%s): %s", event->achievement->id, event->achievement->title,
event->achievement->measured_progress);
s_active_progress_indicator->achievement = event->achievement;
s_active_progress_indicator->active = true;
Expand All @@ -1341,13 +1341,13 @@ void Achievements::HandleServerErrorEvent(const rc_client_event_t* event)
std::string message = fmt::format(TRANSLATE_FS("Achievements", "Server error in {0}:\n{1}"),
event->server_error->api ? event->server_error->api : "UNKNOWN",
event->server_error->error_message ? event->server_error->error_message : "UNKNOWN");
Console.Error("(Achievements) %s", message.c_str());
Console.Error("Achievements: %s", message.c_str());
Host::AddOSDMessage(std::move(message), Host::OSD_ERROR_DURATION);
}

void Achievements::HandleServerDisconnectedEvent(const rc_client_event_t* event)
{
Console.Warning("(Achievements) Server disconnected.");
Console.Warning("Achievements: Server disconnected.");

MTGS::RunOnGSThread([]() {
if (ImGuiManager::InitializeFullscreenUI())
Expand All @@ -1360,7 +1360,7 @@ void Achievements::HandleServerDisconnectedEvent(const rc_client_event_t* event)

void Achievements::HandleServerReconnectedEvent(const rc_client_event_t* event)
{
Console.Warning("(Achievements) Server reconnected.");
Console.Warning("Achievements: Server reconnected.");

MTGS::RunOnGSThread([]() {
if (ImGuiManager::InitializeFullscreenUI())
Expand All @@ -1385,7 +1385,7 @@ void Achievements::ResetClient()
if (!IsActive())
return;

Console.WriteLn("(Achievements) Reset client");
Console.WriteLn("Achievements: Reset client");
rc_client_reset(s_client);
}

Expand Down Expand Up @@ -1811,11 +1811,11 @@ void Achievements::Logout()
if (HasActiveGame())
ClearGameInfo();

Console.WriteLn("(Achievements) Logging out...");
Console.WriteLn("Achievements: Logging out...");
rc_client_logout(s_client);
}

Console.WriteLn("(Achievements) Clearing credentials...");
Console.WriteLn("Achievements: Clearing credentials...");
Host::RemoveBaseSettingValue("Achievements", "Username");
Host::RemoveBaseSettingValue("Achievements", "Token");
Host::RemoveBaseSettingValue("Achievements", "LoginTimestamp");
Expand Down Expand Up @@ -1961,7 +1961,7 @@ void Achievements::DrawGameOverlays()

if (!indicator.active && opacity <= 0.01f)
{
DevCon.WriteLn("(Achievements) Remove challenge indicator");
DevCon.WriteLn("Achievements: Remove challenge indicator");
it = s_active_challenge_indicators.erase(it);
}
else
Expand Down Expand Up @@ -2004,7 +2004,7 @@ void Achievements::DrawGameOverlays()

if (!indicator.active && opacity <= 0.01f)
{
DevCon.WriteLn("(Achievements) Remove progress indicator");
DevCon.WriteLn("Achievements: Remove progress indicator");
s_active_progress_indicator.reset();
}

Expand Down Expand Up @@ -2046,7 +2046,7 @@ void Achievements::DrawGameOverlays()

if (!indicator.active && opacity <= 0.01f)
{
DevCon.WriteLn("(Achievements) Remove tracker indicator");
DevCon.WriteLn("Achievements: Remove tracker indicator");
it = s_active_leaderboard_trackers.erase(it);
}
else
Expand Down Expand Up @@ -2151,7 +2151,7 @@ bool Achievements::PrepareAchievementsWindow()
RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_PROGRESS /*RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_LOCK_STATE*/);
if (!s_achievement_list)
{
Console.Error("(Achievements) rc_client_create_achievement_list() returned null");
Console.Error("Achievements: rc_client_create_achievement_list() returned null");
return false;
}

Expand Down Expand Up @@ -2489,7 +2489,7 @@ bool Achievements::PrepareLeaderboardsWindow()
s_leaderboard_list = rc_client_create_leaderboard_list(client, RC_CLIENT_LEADERBOARD_LIST_GROUPING_NONE);
if (!s_leaderboard_list)
{
Console.Error("(Achievements) rc_client_create_leaderboard_list() returned null");
Console.Error("Achievements: rc_client_create_leaderboard_list() returned null");
return false;
}

Expand Down Expand Up @@ -2920,7 +2920,7 @@ void Achievements::DrawLeaderboardListEntry(const rc_client_leaderboard_t* lboar

void Achievements::OpenLeaderboard(const rc_client_leaderboard_t* lboard)
{
Console.WriteLn("(Achievements) Opening leaderboard '%s' (%u)", lboard->title, lboard->id);
Console.WriteLn("Achievements: Opening leaderboard '%s' (%u)", lboard->title, lboard->id);

CloseLeaderboard();

Expand Down Expand Up @@ -2974,7 +2974,7 @@ void Achievements::FetchNextLeaderboardEntries()
for (rc_client_leaderboard_entry_list_t* list : s_leaderboard_entry_lists)
start += list->num_entries;

Console.WriteLn("(Achievements) Fetching entries %u to %u", start, start + LEADERBOARD_ALL_FETCH_SIZE);
Console.WriteLn("Achievements: Fetching entries %u to %u", start, start + LEADERBOARD_ALL_FETCH_SIZE);

if (s_leaderboard_fetch_handle)
rc_client_abort_async(s_client, s_leaderboard_fetch_handle);
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/Counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void UpdateVSyncRate(bool force)
vSyncInfoCalc(&vSyncInfo, frames_per_second, total_scanlines);

if (video_mode_initialized)
Console.WriteLn(Color_Green, "(UpdateVSyncRate) Mode Changed to %s.", ReportVideoMode());
Console.WriteLn(Color_Green, "UpdateVSyncRate: Mode Changed to %s.", ReportVideoMode());

if (custom && video_mode_initialized)
Console.WriteLn(Color_StrongGreen, " ... with user configured refresh rate: %.02f Hz", vertical_frequency);
Expand Down
Loading

0 comments on commit 424951e

Please sign in to comment.