Remove deprecated logging system and expose developer logging window (#825)

This commit is contained in:
Crementif 2023-05-20 02:46:12 +02:00 committed by GitHub
parent b8dec03cb5
commit d903b2cf12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 148 additions and 283 deletions

View file

@ -242,7 +242,7 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
// load FILEINFO section
if (fileinfoSection->sectionSize < sizeof(RPLFileInfoData))
{
cemuLog_force("RPLLoader: FILEINFO section size is below expected size");
cemuLog_log(LogType::Force, "RPLLoader: FILEINFO section size is below expected size");
delete rplLoaderContext;
return false;
}
@ -251,7 +251,7 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
uint8* fileInfoRawPtr = (uint8*)(rplData + fileinfoSection->fileOffset);
if (((uint64)fileinfoSection->fileOffset+fileinfoSection->sectionSize) > (uint64)rplSize)
{
cemuLog_force("RPLLoader: FILEINFO section outside of RPL file bounds");
cemuLog_log(LogType::Force, "RPLLoader: FILEINFO section outside of RPL file bounds");
return false;
}
rplLoaderContext->sectionData_fileInfo.resize(fileinfoSection->sectionSize);
@ -260,7 +260,7 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
RPLFileInfoData* fileInfoPtr = (RPLFileInfoData*)rplLoaderContext->sectionData_fileInfo.data();
if (fileInfoPtr->fileInfoMagic != 0xCAFE0402)
{
cemuLog_force("RPLLoader: Invalid FILEINFO magic");
cemuLog_log(LogType::Force, "RPLLoader: Invalid FILEINFO magic");
return false;
}
@ -287,16 +287,16 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
uint32 crcTableExpectedSize = sectionCount * sizeof(uint32be);
if (!RPLLoader_CheckBounds(rplLoaderContext, crcSection->fileOffset, crcTableExpectedSize))
{
cemuLog_force("RPLLoader: CRC section outside of RPL file bounds");
cemuLog_log(LogType::Force, "RPLLoader: CRC section outside of RPL file bounds");
crcSection->sectionSize = 0;
}
else if (crcSection->sectionSize < crcTableExpectedSize)
{
cemuLog_force("RPLLoader: CRC section size (0x{:x}) less than required (0x{:x})", (uint32)crcSection->sectionSize, crcTableExpectedSize);
cemuLog_log(LogType::Force, "RPLLoader: CRC section size (0x{:x}) less than required (0x{:x})", (uint32)crcSection->sectionSize, crcTableExpectedSize);
}
else if (crcSection->sectionSize != crcTableExpectedSize)
{
cemuLog_force("RPLLoader: CRC section size (0x{:x}) does not match expected size (0x{:x})", (uint32)crcSection->sectionSize, crcTableExpectedSize);
cemuLog_log(LogType::Force, "RPLLoader: CRC section size (0x{:x}) does not match expected size (0x{:x})", (uint32)crcSection->sectionSize, crcTableExpectedSize);
}
uint32 crcActualSectionCount = crcSection->sectionSize / sizeof(uint32); // how many CRCs are actually stored
@ -314,7 +314,7 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
uint32 crcFileinfo = rplLoaderContext->GetSectionCRC(sectionCount - 1);
if (crcCalcFileinfo != crcFileinfo)
{
cemuLog_force("RPLLoader: FILEINFO section has CRC mismatch - Calculated: {:08x} Actual: {:08x}", crcCalcFileinfo, crcFileinfo);
cemuLog_log(LogType::Force, "RPLLoader: FILEINFO section has CRC mismatch - Calculated: {:08x} Actual: {:08x}", crcCalcFileinfo, crcFileinfo);
}
rplLoaderContext->sectionAddressTable2[sectionCount - 1].ptr = rplLoaderContext->sectionData_fileInfo.data();
@ -448,7 +448,7 @@ bool RPLLoader_LoadSingleSection(RPLModule* rplLoaderContext, sint32 sectionInde
// copy to mapped address
if(section->virtualAddress < regionMappingInfo->baseAddress || (section->virtualAddress + uncompressedSection->sectionData.size()) > regionMappingInfo->endAddress)
cemuLog_force("RPLLoader: Section {} (0x{:08x} to 0x{:08x}) is not fully contained in it's bounding region (0x{:08x} to 0x{:08x})", sectionIndex, section->virtualAddress, section->virtualAddress + uncompressedSection->sectionData.size(), regionMappingInfo->baseAddress, regionMappingInfo->endAddress);
cemuLog_log(LogType::Force, "RPLLoader: Section {} (0x{:08x} to 0x{:08x}) is not fully contained in it's bounding region (0x{:08x} to 0x{:08x})", sectionIndex, section->virtualAddress, section->virtualAddress + uncompressedSection->sectionData.size(), regionMappingInfo->baseAddress, regionMappingInfo->endAddress);
uint8* sectionAddressPtr = memory_getPointerFromVirtualOffset(sectionAddress);
std::copy(uncompressedSection->sectionData.begin(), uncompressedSection->sectionData.end(), sectionAddressPtr);
@ -612,7 +612,7 @@ bool RPLLoader_LoadSections(sint32 aProcId, RPLModule* rplLoaderContext)
if (section->type == 0x8)
{
cemuLog_force("RPLLoader: Unsupported text section type 0x8");
cemuLog_log(LogType::Force, "RPLLoader: Unsupported text section type 0x8");
cemu_assert_debug(false);
}
@ -931,7 +931,7 @@ bool RPLLoader_FixImportSymbols(RPLModule* rplLoaderContext, sint32 symtabSectio
if (symSectionIndex >= sharedImportTracking.size())
{
cemuLog_force("RPL-Loader: Symbol {} references invalid section", i);
cemuLog_log(LogType::Force, "RPL-Loader: Symbol {} references invalid section", i);
}
else if (sharedImportTracking[symSectionIndex].rplLoaderContext != nullptr)
{
@ -1104,7 +1104,7 @@ bool RPLLoader_ApplySingleReloc(RPLModule* rplLoaderContext, uint32 uknR3, uint8
{
// within range, update jump opcode
if ((jumpDistance & 3) != 0)
cemuLog_force("RPL-Loader: Encountered unaligned RPL_RELOC_REL24");
cemuLog_log(LogType::Force, "RPL-Loader: Encountered unaligned RPL_RELOC_REL24");
opc &= ~0x03fffffc;
opc |= (jumpDistance &0x03fffffc);
*(uint32be*)relocAddr = opc;
@ -1125,7 +1125,7 @@ bool RPLLoader_ApplySingleReloc(RPLModule* rplLoaderContext, uint32 uknR3, uint8
{
// within range, update jump opcode
if ((jumpDistance & 3) != 0)
cemuLog_force("RPL-Loader: Encountered unaligned RPL_RELOC_REL14");
cemuLog_log(LogType::Force, "RPL-Loader: Encountered unaligned RPL_RELOC_REL14");
opc &= ~0xfffc;
opc |= (jumpDistance & 0xfffc);
*(uint32be*)relocAddr = opc;
@ -1190,7 +1190,7 @@ bool RPLLoader_ApplySingleReloc(RPLModule* rplLoaderContext, uint32 uknR3, uint8
}
else
{
cemuLog_force("RPLLoader: sdata reloc uses register other than r2/r13");
cemuLog_log(LogType::Force, "RPLLoader: sdata reloc uses register other than r2/r13");
cemu_assert(false);
}
}
@ -1224,7 +1224,7 @@ bool RPLLoader_ApplySingleReloc(RPLModule* rplLoaderContext, uint32 uknR3, uint8
}
else
{
cemuLog_force("RPLLoader: Unsupported reloc type 0x{:02x}", relocType);
cemuLog_log(LogType::Force, "RPLLoader: Unsupported reloc type 0x{:02x}", relocType);
cemu_assert_debug(false); // unknown reloc type
}
return true;
@ -1344,7 +1344,7 @@ bool RPLLoader_ApplyRelocs(RPLModule* rplLoaderContext, sint32 relaSectionIndex,
assert_dbg(); // not a TLS symbol
if (rplLoaderContext->fileInfo.tlsModuleIndex == -1)
{
cemuLog_force("RPLLoader: TLS relocs applied to non-TLS module");
cemuLog_log(LogType::Force, "RPLLoader: TLS relocs applied to non-TLS module");
cemu_assert_debug(false); // module not a TLS-module
}
tlsModuleIndex = rplLoaderContext->fileInfo.tlsModuleIndex;
@ -1962,7 +1962,7 @@ void RPLLoader_AddDependency(const char* name)
rplLoader_currentTlsModuleIndex++;
rplLoader_currentHandleCounter++;
if (rplLoader_currentTlsModuleIndex == 0x7FFF)
cemuLog_force("RPLLoader: Exhausted TLS module indices pool");
cemuLog_log(LogType::Force, "RPLLoader: Exhausted TLS module indices pool");
// convert name to path/filename if it isn't already one
if (strchr(name, '.'))
{

View file

@ -254,7 +254,7 @@ namespace coreinit
else
{
if (failedAttempts >= 0x800)
cemuLog_force("Detected long-term contested OSLockMutex");
cemuLog_log(LogType::Force, "Detected long-term contested OSLockMutex");
currentThread->waitingForMutex = mutex;
mutex->threadQueue.queueAndWait(currentThread);
currentThread->waitingForMutex = nullptr;

View file

@ -407,7 +407,7 @@ namespace coreinit
// release held synchronization primitives
if (!threadBE->mutexQueue.isEmpty())
{
cemuLog_force("OSExitThread: Thread is holding mutexes");
cemuLog_log(LogType::Force, "OSExitThread: Thread is holding mutexes");
while (true)
{
OSMutex* mutex = threadBE->mutexQueue.getFirst();
@ -415,7 +415,7 @@ namespace coreinit
break;
if (mutex->owner != threadBE)
{
cemuLog_force("OSExitThread: Thread is holding mutex which it doesn't own");
cemuLog_log(LogType::Force, "OSExitThread: Thread is holding mutex which it doesn't own");
threadBE->mutexQueue.removeMutex(mutex);
continue;
}

View file

@ -355,7 +355,7 @@ namespace H264
uint32 numByteConsumed = 0;
if (!DetermineBufferSizes(data, length, numByteConsumed))
{
cemuLog_force("H264: Unable to determine picture size. Ignoring decode input");
cemuLog_log(LogType::Force, "H264: Unable to determine picture size. Ignoring decode input");
decodeResult.frameReady = false;
return;
}
@ -397,7 +397,7 @@ namespace H264
}
else if (status != 0)
{
cemuLog_force("H264: Failed to decode frame (error 0x{:08x})", status);
cemuLog_log(LogType::Force, "H264: Failed to decode frame (error 0x{:08x})", status);
decodeResult.frameReady = false;
return;
}
@ -901,7 +901,7 @@ namespace H264
}
else
{
cemuLog_force("h264Export_H264DECSetParam(): Unsupported parameterId 0x{:08x}\n", paramId);
cemuLog_log(LogType::Force, "h264Export_H264DECSetParam(): Unsupported parameterId 0x{:08x}\n", paramId);
cemu_assert_unimplemented();
}
return H264DEC_STATUS::SUCCESS;

View file

@ -46,7 +46,7 @@ namespace nn
if (idbeData.size() != sizeof(nnIdbeEncryptedIcon_t))
{
// icon does not exist or has the wrong size
cemuLog_force("IDBE: Failed to retrieve icon for title {:016x}", titleId);
cemuLog_log(LogType::Force, "IDBE: Failed to retrieve icon for title {:016x}", titleId);
memset(iconOut, 0, sizeof(nnIdbeEncryptedIcon_t));
coreinit_resumeThread(thread);
return;

View file

@ -1069,8 +1069,8 @@ namespace snd
{
if (gUnsupportedSoundEffectWarning)
return;
cemuLog_force("The currently running title is trying to utilize an unsupported audio effect");
cemuLog_force("To emulate these correctly, place snd_user.rpl and snduser2.rpl from the original Wii U firmware in /cafeLibs/ folder");
cemuLog_log(LogType::Force, "The currently running title is trying to utilize an unsupported audio effect");
cemuLog_log(LogType::Force, "To emulate these correctly, place snd_user.rpl and snduser2.rpl from the original Wii U firmware in /cafeLibs/ folder");
gUnsupportedSoundEffectWarning = true;
}
@ -1104,17 +1104,17 @@ namespace snd
void AXFXReverbHiInit(AXFXReverbHiData* param)
{
cemuLog_force("AXFXReverbHiInit - stub");
cemuLog_log(LogType::Force, "AXFXReverbHiInit - stub");
}
void AXFXReverbHiSettings(AXFXReverbHiData* param)
{
cemuLog_force("AXFXReverbHiSettings - stub");
cemuLog_log(LogType::Force, "AXFXReverbHiSettings - stub");
}
void AXFXReverbHiShutdown(AXFXReverbHiData* param)
{
cemuLog_force("AXFXReverbHiShutdown - stub");
cemuLog_log(LogType::Force, "AXFXReverbHiShutdown - stub");
}
void AXFXReverbHiCallback(AUXCBSAMPLEDATA* auxSamples, AXFXReverbHiData* reverbHi)
@ -1133,7 +1133,7 @@ namespace snd
void AXFXMultiChReverbInit(AXFXMultiChReverbData* param, int ukn2, int ukn3)
{
cemuLog_force("AXFXMultiChReverbInit (Stubbed)");
cemuLog_log(LogType::Force, "AXFXMultiChReverbInit (Stubbed)");
}
void AXFXMultiChReverbSettingsUpdate(AXFXMultiChReverbData* param)