Use fmt::format for LOGERROR

The format string can be checked at compile time. It will be easier to
transition to `std::format`.
This commit is contained in:
phosit committed 2026-10-05 20:29:26 +02:00
1 parent ba158aa3ff
commit 369a7e7e5d
115 files changed
+631 -454

No files matched your search

@@ -64,7 +64,7 @@ void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global)
JS::RootedValue msgVal(rq.cx, msg.ToJSValCached(rq));
if (!Script::Function::CallVoid(rq, GetInstance(), name, msgVal))
LOGERROR("Script message handler %s failed", name);
LOGERROR("Script message handler {} failed", name);
}
void CComponentTypeScript::Serialize(ISerializer& serialize)
@@ -81,7 +81,8 @@ void CComponentTypeScript::Serialize(ISerializer& serialize)
Script::GetProperty(rq, GetInstance(), "entity", ent);
std::string name = "(error)";
Script::GetObjectClassName(rq, GetInstance(), name);
LOGERROR("Script component %s of entity %i failed to serialize: %s\nSerializing:\n%s", name, ent, err.what(), Script::ToString(rq, GetMutInstance()));
LOGERROR("Script component {} of entity {} failed to serialize: {}\nSerializing:\n{}",
name, ent, err.what(), Script::ToString(rq, GetMutInstance()));
// Rethrow now that we added more details
throw;
}
@@ -56,7 +56,7 @@ public:
Script::Request rq(m_ScriptInterface);
if (Script::Function::Call(rq, GetInstance(), funcname, ret, params...))
return ret;
LOGERROR("Error calling component script function %s", funcname);
LOGERROR("Error calling component script function {}", funcname);
return R();
}
@@ -66,7 +66,7 @@ public:
{
Script::Request rq(m_ScriptInterface);
if (!Script::Function::Call(rq, GetInstance(), funcname, ret, params...))
LOGERROR("Error calling component script function %s", funcname);
LOGERROR("Error calling component script function {}", funcname);
}
template<typename... Ts>
@@ -74,7 +74,7 @@ public:
{
Script::Request rq(m_ScriptInterface);
if (!Script::Function::CallVoid(rq, GetInstance(), funcname, params...))
LOGERROR("Error calling component script function %s", funcname);
LOGERROR("Error calling component script function {}", funcname);
}
private: