Skip to content

Commit

Permalink
proton: Make log directory configurable via PROTON_LOG_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Newbytee authored and aeikum committed Oct 19, 2020
1 parent d4838fb commit f4ae087
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ the Wine prefix. Removing the option will revert to the previous behavior.

| 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_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. |
Expand Down
4 changes: 3 additions & 1 deletion proton
Original file line number Diff line number Diff line change
Expand Up @@ -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+")
Expand Down
3 changes: 2 additions & 1 deletion user_settings.sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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-<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
"WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree",
Expand Down

0 comments on commit f4ae087

Please sign in to comment.