Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9360 from Minty-Meeo/osreport-split
Split OSREPORT logging type
  • Loading branch information
leoetlino committed Dec 26, 2020
2 parents 6ddf69d + b430d66 commit d2f9991
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions Source/Core/Common/Logging/Log.h
Expand Up @@ -52,6 +52,7 @@ enum LOG_TYPE
NETPLAY,
OSHLE,
OSREPORT,
OSREPORT_HLE,
PAD,
PIXELENGINE,
PROCESSORINTERFACE,
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Common/Logging/LogManager.cpp
Expand Up @@ -154,7 +154,8 @@ LogManager::LogManager()
m_log[MEMMAP] = {"MI", "Memory Interface & Memory Map"};
m_log[NETPLAY] = {"NETPLAY", "Netplay"};
m_log[OSHLE] = {"HLE", "OSHLE"};
m_log[OSREPORT] = {"OSREPORT", "OSReport"};
m_log[OSREPORT] = {"OSREPORT", "OSReport EXI"};
m_log[OSREPORT_HLE] = {"OSREPORT_HLE", "OSReport HLE"};
m_log[PAD] = {"PAD", "Pad"};
m_log[PIXELENGINE] = {"PE", "Pixel Engine"};
m_log[PROCESSORINTERFACE] = {"PI", "Processor Interface"};
Expand Down
16 changes: 8 additions & 8 deletions Source/Core/Core/HLE/HLE_OS.cpp
Expand Up @@ -38,7 +38,7 @@ void HLE_OSPanic()
StringPopBackIf(&msg, '\n');

PanicAlertFmt("OSPanic: {}: {}", error, msg);
ERROR_LOG_FMT(OSREPORT, "{:08x}->{:08x}| OSPanic: {}: {}", LR, PC, error, msg);
ERROR_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| OSPanic: {}: {}", LR, PC, error, msg);

NPC = LR;
}
Expand Down Expand Up @@ -82,7 +82,7 @@ void HLE_GeneralDebugPrint(ParameterType parameter_type)

NPC = LR;

NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}

// Generalized function for printing formatted string using parameter list.
Expand All @@ -105,22 +105,22 @@ void HLE_write_console()
{
const u32 size = PowerPC::Read_U32(GPR(5));
if (size > report_message.size())
WARN_LOG_FMT(OSREPORT, "__write_console uses an invalid size of {:#010x}", size);
WARN_LOG_FMT(OSREPORT_HLE, "__write_console uses an invalid size of {:#010x}", size);
else if (size == 0)
WARN_LOG_FMT(OSREPORT, "__write_console uses a size of zero");
WARN_LOG_FMT(OSREPORT_HLE, "__write_console uses a size of zero");
else
report_message = report_message.substr(0, size);
}
else
{
ERROR_LOG_FMT(OSREPORT, "__write_console uses an unreachable size pointer");
ERROR_LOG_FMT(OSREPORT_HLE, "__write_console uses an unreachable size pointer");
}

StringPopBackIf(&report_message, '\n');

NPC = LR;

NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}

// Log (v)dprintf message if fd is 1 (stdout) or 2 (stderr)
Expand All @@ -133,7 +133,7 @@ void HLE_LogDPrint(ParameterType parameter_type)

std::string report_message = GetStringVA(4, parameter_type);
StringPopBackIf(&report_message, '\n');
NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}

// Log dprintf message
Expand Down Expand Up @@ -173,7 +173,7 @@ void HLE_LogFPrint(ParameterType parameter_type)

std::string report_message = GetStringVA(4, parameter_type);
StringPopBackIf(&report_message, '\n');
NOTICE_LOG_FMT(OSREPORT, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
}

// Log fprintf message
Expand Down

0 comments on commit d2f9991

Please sign in to comment.