general: Make formatting of logged hex values more straightforward

This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
This commit is contained in:
Lioncash 2018-05-02 09:14:28 -04:00
parent 8262aeeac8
commit 7c9644646f
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
29 changed files with 105 additions and 104 deletions

View file

@ -60,7 +60,7 @@ static std::string MakeFunctionString(const char* name, const char* port_name,
std::string function_string = fmt::format("function '{}': port={}", name, port_name);
for (int i = 1; i <= num_params; ++i) {
function_string += fmt::format(", cmd_buff[{}]={:#X}", i, cmd_buff[i]);
function_string += fmt::format(", cmd_buff[{}]=0x{:X}", i, cmd_buff[i]);
}
return function_string;
}
@ -113,10 +113,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext
std::string function_name = info == nullptr ? fmt::format("{}", ctx.GetCommand()) : info->name;
fmt::memory_buffer buf;
fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]={:#x}", function_name, service_name,
cmd_buf[0]);
fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]=0x{:X}", function_name,
service_name, cmd_buf[0]);
for (int i = 1; i <= 8; ++i) {
fmt::format_to(buf, ", [{}]={:#x}", i, cmd_buf[i]);
fmt::format_to(buf, ", [{}]=0x{:X}", i, cmd_buf[i]);
}
buf.push_back('}');