Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR changes the default behavior for verbose logging output in the HMCL launcher by inverting the logic to enable verbose output by default unless explicitly disabled.
- Changes the verbose output flag logic from opt-in to opt-out behavior
- Now enables verbose logging by default unless the environment variable is explicitly set to "false"
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { | ||
| HLVerboseOutput = HLGetEnvVar(L"HMCL_LAUNCHER_VERBOSE_OUTPUT").value_or(L"") == L"true"; | ||
| HLVerboseOutput = HLGetEnvVar(L"HMCL_LAUNCHER_VERBOSE_OUTPUT").value_or(L"") != L"false"; |
There was a problem hiding this comment.
The logic change from opt-in to opt-out for verbose output could impact users who rely on the current quiet default behavior. Consider using a more explicit approach like checking for both 'true' and 'false' values, with a clear documented default, to make the behavior more predictable.
Suggested change
| HLVerboseOutput = HLGetEnvVar(L"HMCL_LAUNCHER_VERBOSE_OUTPUT").value_or(L"") != L"false"; | |
| // Explicitly check for "true" or "1" (case-insensitive), default to false | |
| auto verboseEnv = HLGetEnvVar(L"HMCL_LAUNCHER_VERBOSE_OUTPUT"); | |
| std::wstring verboseValue = verboseEnv.value_or(L""); | |
| std::transform(verboseValue.begin(), verboseValue.end(), verboseValue.begin(), ::towlower); | |
| HLVerboseOutput = (verboseValue == L"true" || verboseValue == L"1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.