Frontends: Migrate logs over to fmt

This commit is contained in:
Lioncash 2020-11-25 21:13:50 -05:00
parent 4c9ffb58fa
commit ffbf3d71f0
6 changed files with 25 additions and 25 deletions

View File

@ -184,8 +184,8 @@ void ConvertDialog::OnFormatChanged()
constexpr int FALLBACK_BLOCK_SIZE = 0x4000;
if (!block_size_ok(FALLBACK_BLOCK_SIZE))
{
ERROR_LOG(MASTER_LOG, "Failed to find a block size which does not cause problems "
"when decompressing using an old version of Dolphin");
ERROR_LOG_FMT(MASTER_LOG, "Failed to find a block size which does not cause problems "
"when decompressing using an old version of Dolphin");
}
AddToBlockSizeComboBox(FALLBACK_BLOCK_SIZE);
}

View File

@ -373,7 +373,7 @@ void GCMemcardManager::ImportFile()
}
if (!m_slot_memcard[m_active_slot]->Save())
PanicAlertT("File write failed");
PanicAlertFmtT("File write failed");
UpdateSlotTable(m_active_slot);
}
@ -401,7 +401,7 @@ void GCMemcardManager::CopyFiles()
for (int i = 0; i < SLOT_COUNT; i++)
{
if (!m_slot_memcard[i]->Save())
PanicAlertT("File write failed");
PanicAlertFmtT("File write failed");
UpdateSlotTable(i);
}
@ -444,7 +444,7 @@ void GCMemcardManager::DeleteFiles()
if (!memcard->Save())
{
PanicAlertT("File write failed");
PanicAlertFmtT("File write failed");
}
else
{
@ -461,7 +461,7 @@ void GCMemcardManager::FixChecksums()
memcard->FixChecksums();
if (!memcard->Save())
PanicAlertT("File write failed");
PanicAlertFmtT("File write failed");
}
void GCMemcardManager::CreateNewCard(int slot)

View File

@ -1601,10 +1601,10 @@ void MenuBar::SearchInstruction()
QString::fromStdString(PPCTables::GetInstructionName(PowerPC::HostRead_U32(addr)));
if (op == ins_name)
{
NOTICE_LOG(POWERPC, "Found %s at %08x", op.toStdString().c_str(), addr);
NOTICE_LOG_FMT(POWERPC, "Found {} at {:08x}", op.toStdString(), addr);
found = true;
}
}
if (!found)
NOTICE_LOG(POWERPC, "Opcode %s not found", op.toStdString().c_str());
NOTICE_LOG_FMT(POWERPC, "Opcode {} not found", op.toStdString());
}

View File

@ -427,7 +427,7 @@ void NetPlayDialog::OnStart()
const auto game = FindGameFile(m_current_game_identifier);
if (!game)
{
PanicAlertT("Selected game doesn't exist in game list!");
PanicAlertFmtT("Selected game doesn't exist in game list!");
return;
}
@ -876,7 +876,7 @@ void NetPlayDialog::OnMsgStartGame()
if (auto game = FindGameFile(m_current_game_identifier))
client->StartGame(game->GetFilePath());
else
PanicAlertT("Selected game doesn't exist in game list!");
PanicAlertFmtT("Selected game doesn't exist in game list!");
}
UpdateDiscordPresence();
});
@ -1099,7 +1099,7 @@ void NetPlayDialog::LoadSettings()
}
else
{
WARN_LOG(NETPLAY, "Unknown network mode '%s', using 'fixeddelay'", network_mode.c_str());
WARN_LOG_FMT(NETPLAY, "Unknown network mode '{}', using 'fixeddelay'", network_mode);
m_fixed_delay_action->setChecked(true);
}
}

View File

@ -150,24 +150,24 @@ public:
if (!file)
{
WARN_LOG(COMMON, "Error reading MO file '%s'", filename.c_str());
WARN_LOG_FMT(COMMON, "Error reading MO file '{}'", filename);
m_data = {};
return;
}
u32 magic = ReadU32(&m_data[0]);
const u32 magic = ReadU32(&m_data[0]);
if (magic != MO_MAGIC_NUMBER)
{
ERROR_LOG(COMMON, "MO file '%s' has bad magic number %x\n", filename.c_str(), magic);
ERROR_LOG_FMT(COMMON, "MO file '{}' has bad magic number {:x}\n", filename, magic);
m_data = {};
return;
}
u16 version_major = ReadU16(&m_data[4]);
const u16 version_major = ReadU16(&m_data[4]);
if (version_major > 1)
{
ERROR_LOG(COMMON, "MO file '%s' has unsupported version number %i", filename.c_str(),
version_major);
ERROR_LOG_FMT(COMMON, "MO file '{}' has unsupported version number {}", filename,
version_major);
m_data = {};
return;
}
@ -300,7 +300,7 @@ static bool TryInstallTranslator(const QString& exact_language_code)
}
translator->deleteLater();
}
ERROR_LOG(COMMON, "No suitable translation file found");
ERROR_LOG_FMT(COMMON, "No suitable translation file found");
return false;
}

View File

@ -39,7 +39,7 @@ bool ToggleFullscreen(Display* dpy, Window win)
if (!XSendEvent(dpy, DefaultRootWindow(dpy), False,
SubstructureRedirectMask | SubstructureNotifyMask, &event))
{
ERROR_LOG(VIDEO, "Failed to switch fullscreen/windowed mode.");
ERROR_LOG_FMT(VIDEO, "Failed to switch fullscreen/windowed mode.");
return false;
}
@ -60,7 +60,7 @@ void InhibitScreensaver(Window win, bool suspend)
while (waitpid(pid, &status, 0) == -1)
;
INFO_LOG(VIDEO, "Started xdg-screensaver (PID = %d)", (int)pid);
INFO_LOG_FMT(VIDEO, "Started xdg-screensaver (PID = {})", pid);
}
}
@ -75,7 +75,7 @@ XRRConfiguration::XRRConfiguration(Display* _dpy, Window _win)
if (!XRRQueryVersion(dpy, &XRRMajorVersion, &XRRMinorVersion) ||
(XRRMajorVersion < 1 || (XRRMajorVersion == 1 && XRRMinorVersion < 3)))
{
WARN_LOG(VIDEO, "XRRExtension not supported.");
WARN_LOG_FMT(VIDEO, "XRRExtension not supported.");
bValid = false;
return;
}
@ -88,7 +88,7 @@ XRRConfiguration::XRRConfiguration(Display* _dpy, Window _win)
fb_width_mm = DisplayWidthMM(dpy, screen);
fb_height_mm = DisplayHeightMM(dpy, screen);
INFO_LOG(VIDEO, "XRRExtension-Version %d.%d", XRRMajorVersion, XRRMinorVersion);
INFO_LOG_FMT(VIDEO, "XRRExtension-Version {}.{}", XRRMajorVersion, XRRMinorVersion);
Update();
}
@ -204,12 +204,12 @@ void XRRConfiguration::Update()
if (outputInfo && crtcInfo && fullMode)
{
INFO_LOG(VIDEO, "Fullscreen Resolution %dx%d", fullWidth, fullHeight);
INFO_LOG_FMT(VIDEO, "Fullscreen Resolution {}x{}", fullWidth, fullHeight);
}
else
{
ERROR_LOG(VIDEO, "Failed to obtain fullscreen size.\n"
"Using current desktop resolution for fullscreen.");
ERROR_LOG_FMT(VIDEO, "Failed to obtain fullscreen size.\n"
"Using current desktop resolution for fullscreen.");
}
}