-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ import { | |
lastPlayLogFileLocation, | ||
logInfo, | ||
LogPrefix, | ||
logsDisabled, | ||
logWarning | ||
} from '../../logger/logger' | ||
import { basename, dirname } from 'path' | ||
|
@@ -264,7 +263,7 @@ export async function launchGame( | |
logFile: lastPlayLogFileLocation(appName), | ||
logMessagePrefix: LogPrefix.Backend, | ||
onOutput: (output) => { | ||
if (!logsDisabled) appendGamePlayLog(gameInfo, output) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably should add that
here as well ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm looks like we have some issues with how we log things with sideloaded games, for native games the logs are just broken (we log the wrong thing in the wrong file and no system info / config) I'm trying to fix that, but feel that should be its own PR to limit the scope of this one |
||
if (gameSettings.verboseLogs) appendGamePlayLog(gameInfo, output) | ||
} | ||
} | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { useContext } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { ToggleSwitch } from 'frontend/components/UI' | ||
import useSetting from 'frontend/hooks/useSetting' | ||
import SettingsContext from '../SettingsContext' | ||
|
||
const VerboseLogs = () => { | ||
const { t } = useTranslation() | ||
|
||
const { isDefault } = useContext(SettingsContext) | ||
|
||
const [verboseLogs, setVerboseLogs] = useSetting('verboseLogs', false) | ||
|
||
if (isDefault) { | ||
return <></> | ||
} | ||
|
||
return ( | ||
<div className="toggleRow"> | ||
<ToggleSwitch | ||
htmlId="verboseLogs" | ||
value={verboseLogs} | ||
handleChange={() => setVerboseLogs(!verboseLogs)} | ||
title={t('setting.verboseLogs.description', 'Enable verbose logs')} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default VerboseLogs |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern with this is that users may see an error message and miss the
IMPORTANT: Logs are disabled. Enable verbose logs before reporting an issue
line and send it anyway without turning on logs (I know it's going to happen anyway, but I think not having anything apart from that line would reduce it the chances)