FEXServer: Add support for FEX Logging control

Always enables FEXServer log thread when built for Steam so that clients
can be controlled with `STEAM_FEX_LOG=1`. FEX logs will then always go
to FEXServer and those can get directed to wherever pressure-vessel
chooses.
This commit is contained in:
Ryan Houdek committed 2025-12-04 14:06:18 -08:00
1 parent cdbf5d57bd
commit f3f134f9de
2 files changed
+17 -1

No files matched your search

+10
View File
@@ -83,6 +83,7 @@ fextl::string GenerateSteamAppConfig(const FEX::Config::PortableInformation& Por
bool Multiblock = true;
bool Thunks_GL = false;
bool Thunks_Vulkan = false;
bool EnableLogging = false;
};
SteamOptions Options {};
@@ -97,6 +98,11 @@ fextl::string GenerateSteamAppConfig(const FEX::Config::PortableInformation& Por
Options.Multiblock = std::strtoull(steam_fex_multiblock, nullptr, 0) != 0;
}
const auto steam_fex_logging = getenv("STEAM_FEX_LOG");
if (steam_fex_logging) {
Options.EnableLogging = std::strtoull(steam_fex_logging, nullptr, 0) != 0;
}
// UI overrides.
const auto steam_fex_compat = getenv("STEAM_COMPAT_FEX_CONFIG");
if (steam_fex_compat) {
@@ -123,6 +129,10 @@ fextl::string GenerateSteamAppConfig(const FEX::Config::PortableInformation& Por
Dest = json_objOpen(Dest, "Config");
Dest = json_str(Dest, "TSOEnabled", Options.TSO ? "1" : "0");
Dest = json_str(Dest, "Multiblock", Options.Multiblock ? "1" : "0");
Dest = json_str(Dest, "SilentLog", Options.EnableLogging ? "0" : "1");
if (Options.EnableLogging) {
Dest = json_str(Dest, "OutputLog", "server");
}
Dest = json_objClose(Dest);
}
+7 -1
View File
@@ -206,7 +206,13 @@ int main(int argc, char** argv, char** const envp) {
LogMan::Msg::DFmt("[FEXServer] Couldn't set subreaper.");
}
if (Options.Foreground) {
bool EnableLoggingThread = Options.Foreground;
#ifndef FEX_STEAM_SUPPORT
// If running with Steam support then always enable the logging thread.
EnableLoggingThread = true;
#endif
if (EnableLoggingThread) {
// Only start a log thread if we are in the foreground.
// Prevents FEX from trying to log to nothing.
Logger::StartLogThread();