Core: Convert logging over to fmt pt.2

Continues the core migration of logs up to the EXI handling code.
This commit is contained in:
Lioncash 2020-11-19 21:45:54 -05:00
commit a0f9b041a0
48 changed files with 504 additions and 488 deletions

View file

@ -121,7 +121,7 @@ void PatchFunctions()
s_hooked_addresses[addr] = i;
PowerPC::ppcState.iCache.Invalidate(addr);
}
INFO_LOG(OSHLE, "Patching %s %08x", os_patches[i].name, symbol->address);
INFO_LOG_FMT(OSHLE, "Patching {} {:08x}", os_patches[i].name, symbol->address);
}
}
}
@ -147,7 +147,7 @@ void Execute(u32 current_pc, u32 hook_index)
}
else
{
PanicAlert("HLE system tried to call an undefined HLE function %i.", hook_index);
PanicAlertFmt("HLE system tried to call an undefined HLE function {}.", hook_index);
}
}

View file

@ -37,8 +37,8 @@ void HLE_OSPanic()
StringPopBackIf(&error, '\n');
StringPopBackIf(&msg, '\n');
PanicAlert("OSPanic: %s: %s", error.c_str(), msg.c_str());
ERROR_LOG(OSREPORT, "%08x->%08x| OSPanic: %s: %s", LR, PC, error.c_str(), msg.c_str());
PanicAlertFmt("OSPanic: {}: {}", error, msg);
ERROR_LOG_FMT(OSREPORT, "{:08x}->{:08x}| OSPanic: {}: {}", LR, PC, error, msg);
NPC = LR;
}
@ -82,7 +82,7 @@ void HLE_GeneralDebugPrint(ParameterType parameter_type)
NPC = LR;
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, SHIFTJISToUTF8(report_message).c_str());
NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}
// Generalized function for printing formatted string using parameter list.
@ -103,24 +103,24 @@ void HLE_write_console()
std::string report_message = GetStringVA(4);
if (PowerPC::HostIsRAMAddress(GPR(5)))
{
u32 size = PowerPC::Read_U32(GPR(5));
const u32 size = PowerPC::Read_U32(GPR(5));
if (size > report_message.size())
WARN_LOG(OSREPORT, "__write_console uses an invalid size of 0x%08x", size);
WARN_LOG_FMT(OSREPORT, "__write_console uses an invalid size of {:#010x}", size);
else if (size == 0)
WARN_LOG(OSREPORT, "__write_console uses a size of zero");
WARN_LOG_FMT(OSREPORT, "__write_console uses a size of zero");
else
report_message = report_message.substr(0, size);
}
else
{
ERROR_LOG(OSREPORT, "__write_console uses an unreachable size pointer");
ERROR_LOG_FMT(OSREPORT, "__write_console uses an unreachable size pointer");
}
StringPopBackIf(&report_message, '\n');
NPC = LR;
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, SHIFTJISToUTF8(report_message).c_str());
NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}
// Log (v)dprintf message if fd is 1 (stdout) or 2 (stderr)
@ -133,7 +133,7 @@ void HLE_LogDPrint(ParameterType parameter_type)
std::string report_message = GetStringVA(4, parameter_type);
StringPopBackIf(&report_message, '\n');
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, SHIFTJISToUTF8(report_message).c_str());
NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}
// Log dprintf message
@ -173,7 +173,7 @@ void HLE_LogFPrint(ParameterType parameter_type)
std::string report_message = GetStringVA(4, parameter_type);
StringPopBackIf(&report_message, '\n');
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, SHIFTJISToUTF8(report_message).c_str());
NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}
// Log fprintf message

View file

@ -42,7 +42,7 @@ u32 HLE::SystemVABI::VAListStruct::GetGPR(u32 gpr) const
{
if (gpr < 3 || gpr > 10)
{
ERROR_LOG(OSHLE, "VAListStruct at %08x doesn't have GPR%d!", m_address, gpr);
ERROR_LOG_FMT(OSHLE, "VAListStruct at {:08x} doesn't have GPR{}!", m_address, gpr);
return 0;
}
const u32 gpr_address = Common::AlignUp(GetGPRArea() + 4 * (gpr - 3), 4);
@ -53,7 +53,7 @@ double HLE::SystemVABI::VAListStruct::GetFPR(u32 fpr) const
{
if (!m_has_fpr_area || fpr < 1 || fpr > 8)
{
ERROR_LOG(OSHLE, "VAListStruct at %08x doesn't have FPR%d!", m_address, fpr);
ERROR_LOG_FMT(OSHLE, "VAListStruct at {:08x} doesn't have FPR{}!", m_address, fpr);
return 0.0;
}
const u32 fpr_address = Common::AlignUp(GetFPRArea() + 8 * (fpr - 1), 8);