[Fix] Prevent last run output to leak to next run's logs #3454
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.
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:
Notice that there are 2
Launch command
lines in the log: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: