Ryan McKenzie's Stay At The System Page, compatible with Skyrim SE 1.5.x and 1.6.x.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
1.1 KiB

#include "StayAtSystemPage.h"
using namespace SKSE;
using namespace SKSE::log;
using namespace SKSE::stl;
namespace {
void InitializeLogging() {
auto path = logger::log_directory();
if (!path) {
stl::report_and_fail("Failed to find standard logging directory"sv);
}
*path /= PluginDeclaration::GetSingleton()->GetName();
*path += ".log"sv;
auto sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(path->string(), true);
auto log = std::make_shared<spdlog::logger>("global log"s, std::move(sink));
log->set_level(spdlog::level::info);
log->flush_on(spdlog::level::info);
spdlog::set_default_logger(std::move(log));
spdlog::set_pattern("[%l] %v"s);
}
}
SKSEPluginLoad(const LoadInterface* skse)
{
InitializeLogging();
auto* plugin = PluginDeclaration::GetSingleton();
auto version = plugin->GetVersion();
log::info("{} {} is loading...", plugin->GetName(), version);
JournalMenuEx::InstallHooks();
log::info("{} has finished loading.", plugin->GetName());
return true;
}