proton: Make log directory configurable via PROTON_LOG_DIR

This commit is contained in:
Newbyte 2020-10-18 13:08:35 +02:00 committed by Andrew Eikum
parent 370dc01d07
commit 6305de83bc
3 changed files with 7 additions and 3 deletions

View File

@ -264,7 +264,8 @@ the Wine prefix. Removing the option will revert to the previous behavior.
| Compat config string | Environment Variable | Description | | Compat config string | Environment Variable | Description |
| :-------------------- | :----------------------------- | :----------- | | :-------------------- | :----------------------------- | :----------- |
| | <tt>PROTON_LOG</tt> | Convenience method for dumping a useful debug log to `$HOME/steam-$APPID.log`. For more thorough logging, use `user_settings.py`. | | | <tt>PROTON_LOG</tt> | Convenience method for dumping a useful debug log to `$PROTON_LOG_DIR/steam-$APPID.log` For more thorough logging, use `user_settings.py`. |
| | <tt>PROTON_LOG_DIR</tt> | Output log files into the directory specified. Defaults to your home directory. |
| | <tt>PROTON_DUMP_DEBUG_COMMANDS</tt> | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. | | | <tt>PROTON_DUMP_DEBUG_COMMANDS</tt> | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. |
| | <tt>PROTON_DEBUG_DIR</tt> | Root directory for the Proton debug scripts, `/tmp` by default. | | | <tt>PROTON_DEBUG_DIR</tt> | Root directory for the Proton debug scripts, `/tmp` by default. |
| <tt>wined3d</tt> | <tt>PROTON_USE_WINED3D</tt> | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11, d3d10, and d3d9. | | <tt>wined3d</tt> | <tt>PROTON_USE_WINED3D</tt> | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11, d3d10, and d3d9. |

4
proton
View File

@ -703,7 +703,9 @@ class Session:
if "SteamGameId" in self.env: if "SteamGameId" in self.env:
if self.env["WINEDEBUG"] != "-all": 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): if os.path.exists(lfile_path):
os.remove(lfile_path) os.remove(lfile_path)
self.log_file = open(lfile_path, "w+") self.log_file = open(lfile_path, "w+")

View File

@ -3,7 +3,8 @@
#Settings here will take effect for all games run in this Proton version. #Settings here will take effect for all games run in this Proton version.
user_settings = { user_settings = {
#Logs are saved to $HOME/steam-<STEAM_GAME_ID>.log, overwriting any previous log with that name. #By default, logs are saved to $HOME/steam-<STEAM_GAME_ID>.log, overwriting any previous log with that name.
#Log directory can be overridden with $PROTON_LOG_DIR.
#Wine debug logging #Wine debug logging
"WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree", "WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree",