Skip to content

Replace log.Fatalf with log.Exitf to avoid spamming stderr.#1284

Merged
vladmos merged 3 commits intobazelbuild:mainfrom
paulherman:patch-1
Aug 27, 2024
Merged

Replace log.Fatalf with log.Exitf to avoid spamming stderr.#1284
vladmos merged 3 commits intobazelbuild:mainfrom
paulherman:patch-1

Conversation

@paulherman
Copy link
Contributor

The set of warnings is something that is changing over time. As scripts tend to hardcode these, they get out of date and we hit this unexpected warning code path. There's little benefit of having a stack trace from this issue. Thus, it's more convenient to just print the error itself and nothing else.

The set of warnings is something that is changing over time. As scripts tend to hardcode these, they get out of date and we hit this unexpected warning code path. There's little benefit of having a stack trace from this issue. Thus, it's more convenient to just print the error itself and nothing else.
@vladmos
Copy link
Member

vladmos commented Aug 7, 2024

Does it actually make a difference? According to the docs: Fatalf is equivalent to Printf followed by a call to os.Exit(1).

https://pkg.go.dev/log#Fatalf

Copy link

@lysliu lysliu left a comment

Choose a reason for hiding this comment

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

LGTM

@vladmos vladmos merged commit ec2ed9d into bazelbuild:main Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants