From f4ae0879ea3a57df5453f3f493b3c5305f9d641c Mon Sep 17 00:00:00 2001 From: Newbyte Date: Sun, 18 Oct 2020 13:08:35 +0200 Subject: [PATCH] proton: Make log directory configurable via PROTON_LOG_DIR --- README.md | 3 ++- proton | 4 +++- user_settings.sample.py | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 25acd107..5e81badf 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,8 @@ the Wine prefix. Removing the option will revert to the previous behavior. | Compat config string | Environment Variable | Description | | :-------------------- | :----------------------------- | :----------- | -| | PROTON_LOG | Convenience method for dumping a useful debug log to `$HOME/steam-$APPID.log`. For more thorough logging, use `user_settings.py`. | +| | PROTON_LOG | Convenience method for dumping a useful debug log to `$PROTON_LOG_DIR/steam-$APPID.log` For more thorough logging, use `user_settings.py`. | +| | PROTON_LOG_DIR | Output log files into the directory specified. Defaults to your home directory. | | | PROTON_DUMP_DEBUG_COMMANDS | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. | | | PROTON_DEBUG_DIR | Root directory for the Proton debug scripts, `/tmp` by default. | | wined3d | PROTON_USE_WINED3D | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11, d3d10, and d3d9. | diff --git a/proton b/proton index bb03e942..4921d261 100755 --- a/proton +++ b/proton @@ -520,7 +520,9 @@ class Session: if "SteamGameId" in self.env: if self.env["WINEDEBUG"] != "-all": - lfile_path = os.environ["HOME"] + "/steam-" + os.environ["SteamGameId"] + ".log" + basedir = self.env.get("PROTON_LOG_DIR", os.environ["HOME"]) + makedirs(basedir) + lfile_path = basedir + "/steam-" + os.environ["SteamGameId"] + ".log" if os.path.exists(lfile_path): os.remove(lfile_path) self.log_file = open(lfile_path, "w+") diff --git a/user_settings.sample.py b/user_settings.sample.py index 353c5da1..29d90374 100755 --- a/user_settings.sample.py +++ b/user_settings.sample.py @@ -3,7 +3,8 @@ #Settings here will take effect for all games run in this Proton version. user_settings = { - #Logs are saved to $HOME/steam-.log, overwriting any previous log with that name. + #By default, logs are saved to $HOME/steam-.log, overwriting any previous log with that name. + #Log directory can be overridden with $PROTON_LOG_DIR. #Wine debug logging "WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree",