vlogger: Fixed logic of set log color output parameter.#1148
Open
strike-kokhotnikov wants to merge 1 commit intoMellanox:masterfrom
Open
vlogger: Fixed logic of set log color output parameter.#1148strike-kokhotnikov wants to merge 1 commit intoMellanox:masterfrom
strike-kokhotnikov wants to merge 1 commit intoMellanox:masterfrom
Conversation
|
Can one of the admins verify this patch? |
Greptile OverviewGreptile SummaryFixed a logic bug where Key Changes:
Impact: Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Caller as VMA Main/Sock-Redirect
participant vlog_start as vlog_start()
participant Config as safe_mce_sys()
participant System as isatty()/fileno()
participant Global as g_vlogger_log_in_colors
Note over Global: OLD: initialized to MCE_DEFAULT_LOG_COLORS (true)
Note over Global: NEW: initialized to false
Caller->>Config: get log_colors setting
Config-->>Caller: returns user preference (true/false)
Caller->>vlog_start: vlog_start(..., log_in_colors=user_pref)
vlog_start->>System: fileno(g_vlogger_file)
System-->>vlog_start: file_fd
vlog_start->>System: isatty(file_fd)
System-->>vlog_start: true (TTY) or false (file/pipe)
alt file_fd >= 0 AND isatty(file_fd) AND log_in_colors
vlog_start->>Global: g_vlogger_log_in_colors = log_in_colors
Note over Global: Colors enabled (only for TTY)
else condition not met
Note over Global: OLD: remains true (BUGGY - colors in files!)
Note over Global: NEW: remains false (CORRECT - no colors in files)
end
vlog_start-->>Caller: logger initialized
|
13 tasks
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.
Description
Trivial fix of color log output.
What
Implementation discussion is here: #1136
Change type
What kind of change does this PR introduce?
Check list