mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-20 07:15:38 +00:00
Misc: Get rid of format string for result logging
This commit is contained in:
parent
9f90f14c48
commit
792717e03e
|
@ -351,7 +351,7 @@ void Bus::AddTTYCharacter(char ch)
|
|||
{
|
||||
if (!s_tty_line_buffer.empty())
|
||||
{
|
||||
Log::Writef("TTY", "", LOGLEVEL_INFO, "\033[1;34m%s\033[0m", s_tty_line_buffer.c_str());
|
||||
Log::WriteFmt("TTY", "", LOGLEVEL_INFO, "\033[1;34m{}\033[0m", s_tty_line_buffer);
|
||||
#ifdef _DEBUG
|
||||
if (CPU::IsTraceEnabled())
|
||||
CPU::WriteToExecutionLog("TTY: %s\n", s_tty_line_buffer.c_str());
|
||||
|
|
|
@ -103,15 +103,10 @@ const char* Vulkan::VkResultToString(VkResult res)
|
|||
}
|
||||
}
|
||||
|
||||
void Vulkan::LogVulkanResult(const char* func_name, VkResult res, const char* msg, ...)
|
||||
void Vulkan::LogVulkanResult(const char* func_name, VkResult res, std::string_view msg)
|
||||
{
|
||||
std::va_list ap;
|
||||
va_start(ap, msg);
|
||||
std::string real_msg = StringUtil::StdStringFromFormatV(msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
Log::Writef("VulkanDevice", func_name, LOGLEVEL_ERROR, "%s (%d: %s)", real_msg.c_str(), static_cast<int>(res),
|
||||
VkResultToString(res));
|
||||
Log::WriteFmt("VulkanDevice", func_name, LOGLEVEL_ERROR, "{} (0x{:08X}: {})", msg, static_cast<unsigned>(res),
|
||||
VkResultToString(res));
|
||||
}
|
||||
|
||||
Vulkan::DescriptorSetLayoutBuilder::DescriptorSetLayoutBuilder()
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
#define ENABLE_VULKAN_DEBUG_OBJECTS 1
|
||||
#endif
|
||||
|
||||
#define LOG_VULKAN_ERROR(res, ...) ::Vulkan::LogVulkanResult(__func__, res, __VA_ARGS__)
|
||||
#define LOG_VULKAN_ERROR(res, msg) ::Vulkan::LogVulkanResult(__func__, res, msg)
|
||||
|
||||
namespace Vulkan {
|
||||
// Adds a structure to a chain.
|
||||
void AddPointerToChain(void* head, const void* ptr);
|
||||
|
||||
const char* VkResultToString(VkResult res);
|
||||
void LogVulkanResult(const char* func_name, VkResult res, const char* msg, ...);
|
||||
void LogVulkanResult(const char* func_name, VkResult res, std::string_view msg);
|
||||
|
||||
class DescriptorSetLayoutBuilder
|
||||
{
|
||||
|
|
|
@ -1199,7 +1199,7 @@ void VulkanDevice::WaitForCommandBufferCompletion(u32 index)
|
|||
}
|
||||
else if (res != VK_SUCCESS)
|
||||
{
|
||||
LOG_VULKAN_ERROR(res, "vkWaitForFences() for cmdbuffer %u failed: ", index);
|
||||
LOG_VULKAN_ERROR(res, TinyString::from_format("vkWaitForFences() for cmdbuffer {} failed: ", index));
|
||||
m_last_submit_failed.store(true, std::memory_order_release);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue