Custom Command: Add logging for native custom commands #1128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds logging for native custom commands, where the output (including any errors) will be stored under
STLSHMDIR
aslaunchCustomProg.log
. Proton titles already had this loggiing inextProtonRun
.I would also like to find a way to log the
PROTON_LOG
for Proton custom commands. I'm not sure if it's possible, I think it is from looking at the Proton script - it should default tosteam-proton.log
if there is noSteamGameId
in the environment, and I'm not sure if it will pick up the game AppID by default. If it does, we can temporarily unset this var before launching, and re-set it after launching as a hacky workaround if we really must.We could even temporarily manipulate the value of
SteamGameId
to allow us to set the log file to something likesteam-<gameid>-customcmd.log
so that it is obvious the log is for a custom command pertaining to the given AppID.Allowing a Proton log has the added benefit of being able to see some Proton-specific environment variables being set. The Proton script has a section where it tries to, for example, log information about the current Steam Linux Runtime. We could re-implement this ourselves, but I'd rather hook into what Proton is currently doing.
All this also hinges on whether or not custom commands running with Proton can even use
PROTON_LOG
. When usingONLY_CUSTOMCMD
in particular I'm not sure how many of our set environment variables (Proton-related or otherwise) get passed to custom commands, for example the ones in the per-game environment variable file, and the global one.This PR does accomplish one logging improvement, but further improvement to be able to give a Proton log since we run custom commands with Proton would be pretty nice.