Skip to content

Commit

Permalink
Merge pull request Ryan-rsm-McKenzie#134 from qudix/devex
Browse files Browse the repository at this point in the history
fix: init-ing logger too early
  • Loading branch information
powerof3 authored Sep 7, 2024
2 parents 3dc82f5 + 0b0c1f8 commit 67a221f
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 67a221f

Please sign in to comment.