CharmedBaryon / CommonLibSSE-NG

This is a reverse engineered library for Skyrim Special Edition and Skyrim VR.
MIT License
135 stars 31 forks source link

Logs in My Games\Skyrim.INI\SKSE instead of My Games\Skyrim Special Edition\SKSE #98

Open obewan opened 1 week ago

obewan commented 1 week ago

Since the last skse64_1_6_1170 log files of the plugins are put in the directory My Games\Skyrim.INI\SKSE instead of My Games\Skyrim Special Edition\SKSE. I've try with latest CommonLibSSE-NG 3.7.0, same. Also I use a template: https://github.com/SkyrimDev/HelloWorld-using-CommonLibSSE-NG

I use this function to log, quite a famous function:

void SetupLog() {
    auto logsFolder = SKSE::log::log_directory();
    if (!logsFolder) {
        SKSE::stl::report_and_fail("SKSE log_directory not provided, logs disabled.");
        return;
    }

    auto logFilePath = *logsFolder / std::format("{}.log", Plugin::NAME);
    auto fileLoggerPtr = std::make_shared<spdlog::sinks::basic_file_sink_mt>(logFilePath.string(), true);
    auto loggerPtr = std::make_shared<spdlog::logger>("log", std::move(fileLoggerPtr));
    spdlog::set_default_logger(std::move(loggerPtr));
    spdlog::set_level(spdlog::level::trace);
    spdlog::flush_on(spdlog::level::info);
}

I guess I should indicate somewhere to use the latest SKSE, it's my first SKSE plugin, any help is welcome. Also there's lot of SKSE plugins that have this issue now.