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

[UX] Enable/disable logs game-by-game instead of globally #4214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Dec 27, 2024

Currently, we can only enable/disable logs globally to log game output.

This has some issues:

  • the setting to disable all logs is not next to the game's settings, so it's not easy to find for users
  • logs can impact performance (specially for games with a lot of output) and disk usage, having to enable logs for all games to debug one game means a user can forget to disable it after debugging one game and it will silently apply to all games, logging unnecessary information for games that are already working
  • we were enabling all logs by default, which meant users had to know they can disable them

This PR changes that so we can enable verbose logs in a game-by-game basis. Some benefits:

  • If I forget the logs "on" for a game, it won't affect the other games
  • The setting is now in the Advanced tab in the game's settings, so it's easier to find
  • Now the log file shows a message telling the user that logs are disabled, and tells them to enable verbose logs before reporting a problem

This also enables me to do another change I want to do related to logs and UX, but I'll keep that in another PR to keep this one smaller.


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 Dec 27, 2024
@arielj arielj requested review from Etaash-mathamsetty, a team, flavioislima, CommandMC, Nocccer and imLinguin and removed request for a team December 27, 2024 14:19
@@ -262,7 +261,7 @@ export async function launchGame(
logFile: lastPlayLogFileLocation(appName),
logMessagePrefix: LogPrefix.Backend,
onOutput: (output) => {
if (!logsDisabled) appendGamePlayLog(gameInfo, output)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should add that

  if (!gameSettings.verboseLogs) {
    appendGamePlayLog(
      gameInfo,
      'IMPORTANT: Logs are disabled. Enable verbose logs before reporting an issue.'
    )
  }

here as well ?

Copy link
Member

@Etaash-mathamsetty Etaash-mathamsetty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm other than that one small thing

child.stderr.on('data', (data) => {
appendGamePlayLog(gameInfo, data.toString())
child.on('error', (err: Error) => {
if (gameSettings.verboseLogs) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps errors should ignore this option? They're not exactly frequent after all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

3 participants