Skip to content

Commit

Permalink
migrate to new fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-rsm-McKenzie committed Jul 10, 2023
1 parent 1295fde commit d70cf81
Show file tree
Hide file tree
Showing 34 changed files with 47 additions and 47 deletions.
8 changes: 4 additions & 4 deletions ExampleProject/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ extern "C" DLLEXPORT bool F4SEAPI F4SEPlugin_Query(const F4SE::QueryInterface* a
spdlog::set_default_logger(std::move(log));
spdlog::set_pattern("%g(%#): [%^%l%$] %v"s);

logger::info(FMT_STRING("{} v{}"), Version::PROJECT, Version::NAME);
logger::info("{} v{}", Version::PROJECT, Version::NAME);

a_info->infoVersion = F4SE::PluginInfo::kVersion;
a_info->name = Version::PROJECT.data();
a_info->version = Version::MAJOR;

if (a_f4se->IsEditor()) {
logger::critical("loaded in editor"sv);
logger::critical("loaded in editor");
return false;
}

const auto ver = a_f4se->RuntimeVersion();
if (ver < F4SE::RUNTIME_1_10_162) {
logger::critical(FMT_STRING("unsupported runtime v{}"), ver.string());
logger::critical("unsupported runtime v{}", ver.string());
return false;
}

Expand All @@ -48,7 +48,7 @@ extern "C" DLLEXPORT bool F4SEAPI F4SEPlugin_Load(const F4SE::LoadInterface* a_f
{
F4SE::Init(a_f4se);

logger::info("hello world!"sv);
logger::info("hello world!");

return true;
}
12 changes: 6 additions & 6 deletions F4SEStub/loader/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace win32
{
throw std::runtime_error{
fmt::format(
FMT_STRING("{:08X}: {}"),
"{:08X}: {}",
::GetLastError(),
a_error)
};
Expand Down Expand Up @@ -206,7 +206,7 @@ namespace cli
} else {
throw args::ParseError(
fmt::format(
FMT_STRING("Argument \'{}\' received invalid value type \'{}\'"),
"Argument \'{}\' received invalid value type \'{}\'",
a_name,
a_value));
}
Expand Down Expand Up @@ -268,7 +268,7 @@ namespace cli
return std::nullopt;
} catch (const args::ParseError& a_err) {
spdlog::error(a_err.what());
spdlog::trace(""sv);
spdlog::trace("");
spdlog::trace(p);
return std::nullopt;
}
Expand Down Expand Up @@ -850,7 +850,7 @@ void augment_environment(
} else {
const auto version = win32::get_file_version(exe);
return fmt::format(
FMT_STRING("{}_{}_{}_{}.dll"),
"{}_{}_{}_{}.dll",
(a_options.editor ?
"f4se_editor"s :
"f4se"s),
Expand All @@ -863,7 +863,7 @@ void augment_environment(
const auto error = [](std::string_view a_file) {
throw std::runtime_error(
fmt::format(
FMT_STRING("file does not exist: {}"),
"file does not exist: {}",
a_file));
};
if (!std::filesystem::exists(exe)) {
Expand Down Expand Up @@ -1005,7 +1005,7 @@ int wmain(int a_argc, wchar_t* a_argv[])
spdlog::error(a_err.what());
return EXIT_FAILURE;
} catch (...) {
spdlog::error("caught unknown exception"sv);
spdlog::error("caught unknown exception");
return EXIT_FAILURE;
}

Expand Down
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace Papyrus
BIND(GetWornItemMods);
BIND(QueueUpdate);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/ActorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace Papyrus
BIND(HasHeadPartOverlays);
BIND(SetBodyWeight);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Armor.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Papyrus

BIND(GetArmorAddons);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/ArmorAddon.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Papyrus

BIND(GetAdditionalRaces);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Papyrus

BIND(GetWaterType);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Papyrus
BIND(SetScrapItem);
BIND(SetScrapScalar);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/ConstructibleObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace Papyrus
BIND(SetPriority);
BIND(SetWorkbenchKeyword);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/DefaultObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Papyrus
BIND(GetDefaultObject);
BIND(Set);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/EncounterZone.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace Papyrus
BIND(SetRank);
BIND(SetWorkshop);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/EquipSlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Papyrus

BIND(GetParents);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/F4SE.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Papyrus
BIND(GetVersionMinor, true);
BIND(GetVersionRelease, true);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Form.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ namespace Papyrus
BIND(SetWeight);
BIND(SetWorldModelPath);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace Papyrus
BIND(SetGameSettingString);
BIND(UpdateThirdPerson);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/HeadPart.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace Papyrus
BIND(IsExtraPart);
BIND(SetValidRaces);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Input.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ namespace Papyrus
BIND(GetMappedControl, true);
BIND(GetMappedKey, true);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/InstanceData.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ namespace Papyrus
//BIND(SetStagger);
//BIND(SetWeight);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Location.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Papyrus
BIND(SetEncounterZone);
BIND(SetParent);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/MatSwap.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace Papyrus
BIND(GetRemapData);
BIND(SetRemapData);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Math.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace Papyrus
BIND(LogicalXor, true);
BIND(RightShift, true);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/MiscObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Papyrus
BIND(GetMiscComponents);
BIND(SetMiscComponents);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/ObjectMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ namespace Papyrus
BIND(SetMaxRank);
BIND(SetPriority);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/ObjectReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace Papyrus
BIND(SetMaterialSwap);
//BIND(TransmitConnectedPower, true);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Papyrus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace Papyrus
WaterType::Bind(*a_vm);
Weapon::Bind(*a_vm);

logger::info("bound all scripts"sv);
logger::info("bound all scripts");
return true;
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Perk.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Papyrus
BIND(IsHidden);
BIND(IsPlayable);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/ScriptObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace Papyrus
//BIND(UnregisterForExternalEvent);
//BIND(UnregisterForKey);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/UI.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace Papyrus
//BIND(RegisterCustomMenu, true);
//BIND(Set, true);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Papyrus
BIND(VarArrayToVar, true);
BIND(VarToVarArray, true);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/WaterType.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Papyrus
BIND(SetConsumeSpell);
BIND(SetContactSpell);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
2 changes: 1 addition & 1 deletion F4SEStub/runtime/src/Papyrus/Weapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Papyrus
BIND(GetEmbeddedMod);
BIND(SetEmbeddedMod);

logger::info("bound {} script"sv, obj);
logger::info("bound {} script", obj);
}
}
}
6 changes: 3 additions & 3 deletions F4SEStub/runtime/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ extern "C" DLLEXPORT bool F4SEAPI F4SEPlugin_Query(const F4SE::QueryInterface* a
a_info->version = Version::MAJOR;

if (a_f4se->IsEditor()) {
logger::critical("loaded in editor"sv);
logger::critical("loaded in editor");
return false;
}

const auto ver = a_f4se->RuntimeVersion();
if (ver < F4SE::RUNTIME_1_10_162) {
logger::critical("unsupported runtime v{}"sv, ver.string());
logger::critical("unsupported runtime v{}", ver.string());
return false;
}

Expand All @@ -48,7 +48,7 @@ extern "C" DLLEXPORT bool F4SEAPI F4SEPlugin_Load(const F4SE::LoadInterface* a_f
{
F4SE::Init(a_f4se);

logger::info("loaded f4se stub v{}"sv, Version::NAME);
logger::info("loaded f4se stub v{}", Version::NAME);

const auto papyrus = F4SE::GetPapyrusInterface();
papyrus->Register(Papyrus::Bind);
Expand Down
6 changes: 3 additions & 3 deletions F4SEStub/steam_loader/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void* get_iat(
assert(a_module != nullptr);
const auto dosHeader = reinterpret_cast<::IMAGE_DOS_HEADER*>(a_module);
if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
util::error("invalid dos header"sv);
util::error("invalid dos header");
}

const auto ntHeader = util::adjust_pointer<::IMAGE_NT_HEADERS>(dosHeader, dosHeader->e_lfanew);
Expand All @@ -306,7 +306,7 @@ void* get_iat(
}
}

util::error("failed to find {}!{}"sv, a_dll, a_function);
util::error("failed to find {}!{}", a_dll, a_function);
}

void initialize_log()
Expand Down Expand Up @@ -392,7 +392,7 @@ int safe_initialize()
spdlog::error(a_err.what());
return EXIT_FAILURE;
} catch (...) {
spdlog::error("caught unknown exception"sv);
spdlog::error("caught unknown exception");
return EXIT_FAILURE;
}

Expand Down
Loading

0 comments on commit d70cf81

Please sign in to comment.