From 0b0c1f898268fb64116130d83aba4d52963282d9 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Sat, 7 Sep 2024 01:43:40 -0500 Subject: [PATCH] fix: init-ing logger too early --- src/SKSE/API.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/SKSE/API.cpp b/src/SKSE/API.cpp index ff5506187..4202ba800 100644 --- a/src/SKSE/API.cpp +++ b/src/SKSE/API.cpp @@ -74,16 +74,12 @@ namespace SKSE } } - void Init(const LoadInterface* a_intfc, const bool a_log) noexcept + void Init(const LoadInterface* a_intfc, [[maybe_unused]] const bool a_log) noexcept { if (!a_intfc) { stl::report_and_fail("interface is null"sv); } - if (a_log) { - log::init(); - } - (void)REL::Module::get(); (void)REL::IDDatabase::get(); @@ -97,6 +93,11 @@ namespace SKSE storage.pluginAuthor = pluginVersionData->GetAuthorName(); storage.pluginVersion = pluginVersionData->GetPluginVersion(); } + + if (a_log) { + log::init(); + log::info("{} v{}", GetPluginName(), GetPluginVersion()); + } #endif if (!storage.apiInit) {