proton: Open the log file in append mode.

Opening file in append mode sets the offset to the end of the file prior
to each write. This allows user to append tags/notes to the log file
just before interesting events, e.g.:

    local $ ssh ivyl@test
    test  $ echo "!!! FOCUS CHANGE" >> ~/steam-XYZ.log

The log file is deleted just before we open it anyway, so there won't be
any leftover content from previous session.
This commit is contained in:
Arkadiusz Hiler 2021-05-24 16:09:07 +03:00
parent a0c2cf6cac
commit d2d52bd68a

2
proton
View file

@ -791,7 +791,7 @@ class Session:
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+")
self.log_file = open(lfile_path, "a")
self.log_file.write("======================\n")
with open(g_proton.version_file, "r") as f:
self.log_file.write("Proton: " + f.readline().strip() + "\n")