Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Prevent last run output to leak to next run's logs #3454

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Jan 20, 2024

There is a small an inoffensive bug with gog games and logs, but it can cause confusion during support requests:
the gogdl command prints the launch command to the output a moment after the process ends, when a game launch is aborted, this happens AFTER Heroic calls the stopLogger method. This causes a new logger to be initialized with that last message in the queue, and it's used in the next run, printing a message from a previous run before the actual run's logs.

This PR fixes that by only initializing the logger when calling initGameLog and not on appends.

This is how this can be tested in the current release:

  • start a GOG game
  • abort the launch as soon as possible
  • launch the game again
  • now let it start and close the game correctly
  • open the game logs

Notice that there are 2 Launch command lines in the log:

Launch command: ['/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/bin/wine', "/home/ariel/Games/Heroic/Alwa's Awakening/AlwasAwakening.exe"]

Launch Command: HEROIC_APP_NAME=1396087560 HEROIC_APP_RUNNER=gog HEROIC_APP_SOURCE=gog LD_PRELOAD= DOTNET_BUNDLE_EXTRACT_BASE_DIR= DOTNET_ROOT= WINEPREFIX="/home/ariel/Games/Heroic/Prefixes/Alwas Awakening" WINEDLLOVERRIDES=winemenubuilder.exe=d WINE_FULLSCREEN_FSR=0 WINEESYNC=1 WINEFSYNC=1 ORIG_LD_LIBRARY_PATH= LD_LIBRARY_PATH=/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/lib64:/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/lib GST_PLUGIN_SYSTEM_PATH_1_0=/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/lib64/gstreamer-1.0:/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/lib/gstreamer-1.0 WINEDLLPATH=/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/lib64/wine:/home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/lib/wine /home/ariel/dev/oss/HeroicGamesLauncher/public/bin/linux/gogdl launch "/home/ariel/Games/Heroic/Alwa's Awakening" 1396087560 --wine /home/ariel/.config/heroic/tools/wine/Wine-GE-Proton8-25/bin/wine --platform windows

First line is the last output of gogdl.
Second line is the actual launch command from the current run printed by Heroic.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@arielj arielj added the pr:ready-for-review Feature-complete, ready for the grind! :P label Jan 20, 2024
@arielj arielj requested review from a team, flavioislima, CommandMC, Etaash-mathamsetty, Nocccer and imLinguin and removed request for a team January 20, 2024 02:47
@arielj arielj merged commit 5fecd85 into main Jan 29, 2024
9 checks passed
@arielj arielj deleted the prevent-log-leak branch January 29, 2024 22:00
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants