Core: Convert logging over to fmt pt. 1

Converts up to the DSP-related files for easier reviewing, the rest will
be progressively moved over after this change gets merged.
This commit is contained in:
Lioncash
2020-11-18 06:01:15 -05:00
parent 4eecb8fd11
commit 958cbf38a4
37 changed files with 433 additions and 414 deletions

View File

@ -126,23 +126,23 @@ const char* ElfReader::GetSectionName(int section) const
// This is just a simple elf loader, good enough to load elfs generated by devkitPPC
bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
{
INFO_LOG(MASTER_LOG, "String section: %i", header->e_shstrndx);
INFO_LOG_FMT(MASTER_LOG, "String section: {}", header->e_shstrndx);
if (bRelocate)
{
PanicAlert("Error: Dolphin doesn't know how to load a relocatable elf.");
PanicAlertFmt("Error: Dolphin doesn't know how to load a relocatable elf.");
return false;
}
INFO_LOG(MASTER_LOG, "%i segments:", header->e_phnum);
INFO_LOG_FMT(MASTER_LOG, "{} segments:", header->e_phnum);
// Copy segments into ram.
for (int i = 0; i < header->e_phnum; i++)
{
Elf32_Phdr* p = segments + i;
INFO_LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr,
p->p_filesz, p->p_memsz);
INFO_LOG_FMT(MASTER_LOG, "Type: {} Vaddr: {:08x} Filesz: {} Memsz: {}", p->p_type, p->p_vaddr,
p->p_filesz, p->p_memsz);
if (p->p_type == PT_LOAD)
{
@ -158,11 +158,12 @@ bool ElfReader::LoadIntoMemory(bool only_in_mem1) const
if (srcSize < dstSize)
Memory::Memset(writeAddr + srcSize, 0, dstSize - srcSize); // zero out bss
INFO_LOG(MASTER_LOG, "Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz);
INFO_LOG_FMT(MASTER_LOG, "Loadable Segment Copied to {:08x}, size {:08x}", writeAddr,
p->p_memsz);
}
}
INFO_LOG(MASTER_LOG, "Done loading.");
INFO_LOG_FMT(MASTER_LOG, "Done loading.");
return true;
}