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:
phosit
2026-09-03 15:33:30 +02:00
parent b2496aa9ca
commit 43cb3100b6
26 changed files with 108 additions and 90 deletions
+2 -2
View File
@@ -178,7 +178,7 @@ bool logmsg(JSContext* cx, unsigned int argc, JS::Value* vp)
std::wstring str;
if (!Script::FromJSVal(rq, args[0], str))
return false;
LOGMESSAGE("%s", utf8_from_wstring(str));
LOGMESSAGE("{}", utf8_from_wstring(str));
args.rval().setUndefined();
return true;
}
@@ -602,7 +602,7 @@ bool Interface::SetGlobal_(const char* name, JS::HandleValue value, bool replace
return false;
}
LOGMESSAGE("Hotloading new value for global \"%s\".", name);
LOGMESSAGE("Hotloading new value for global \"{}\".", name);
ENSURE(JS_DeleteProperty(rq.cx, global, name));
}
}