mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-09 11:28:02 +00:00
Use fmt::format for LOGMESSAGE
The format string can be checked at compile time. It will be easier to transition to `std::format`.
This commit is contained in:
26 files changed
+108
-90
No files matched your search
@@ -317,11 +317,11 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
// Handle missing files quietly
|
||||
if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0)
|
||||
{
|
||||
LOGMESSAGE("Cannot find config file \"%s\" - ignoring", m_ConfigFile[ns].string8());
|
||||
LOGMESSAGE("Cannot find config file \"{}\" - ignoring", m_ConfigFile[ns].string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGMESSAGE("Loading config file \"%s\"", m_ConfigFile[ns].string8());
|
||||
LOGMESSAGE("Loading config file \"{}\"", m_ConfigFile[ns].string8());
|
||||
Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen);
|
||||
if (ret != INFO::OK)
|
||||
{
|
||||
@@ -369,7 +369,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
continue;
|
||||
}
|
||||
|
||||
LOGMESSAGE("Found config header '%s'", header.c_str());
|
||||
LOGMESSAGE("Found config header '{}'", header);
|
||||
header.push_back('.');
|
||||
while (++pos < filebufend && *pos != '\n' && *pos != ';')
|
||||
if (*pos != ' ' && *pos != '\r')
|
||||
@@ -445,16 +445,16 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
CStr key(header + name);
|
||||
newMap[key] = values;
|
||||
if (g_UnloggedEntries.find(key) != g_UnloggedEntries.end())
|
||||
LOGMESSAGE("Loaded config string \"%s\"", key);
|
||||
LOGMESSAGE("Loaded config string \"{}\"", key);
|
||||
else if (values.empty())
|
||||
LOGMESSAGE("Loaded config string \"%s\" = (empty)", key);
|
||||
LOGMESSAGE("Loaded config string \"{}\" = (empty)", key);
|
||||
else
|
||||
{
|
||||
std::string vals;
|
||||
for (size_t i = 0; i + 1 < newMap[key].size(); ++i)
|
||||
vals += "\"" + EscapeString(newMap[key][i]) + "\", ";
|
||||
vals += "\"" + EscapeString(newMap[key][values.size()-1]) + "\"";
|
||||
LOGMESSAGE("Loaded config string \"%s\" = %s", key, vals);
|
||||
LOGMESSAGE("Loaded config string \"{}\" = {}", key, vals);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user