Skip to content

Commit

Permalink
fix: init-ing logger too early
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Sep 7, 2024
1 parent 3dc82f5 commit 0b0c1f8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/SKSE/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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) {
Expand Down

0 comments on commit 0b0c1f8

Please sign in to comment.