-
Notifications
You must be signed in to change notification settings - Fork 12
fix: make log messages more AI-friendly #111
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
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -83,7 +83,10 @@ func FindAvailableContainerRuntime(ctx context.Context, log logr.Logger, executo | |||||||||||||||
| return nil, errNoRuntimeFound | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| log.V(1).Info("Runtime status", "Runtime", availableRuntime.orchestrator.Name(), "Status", availableRuntime.status) | ||||||||||||||||
| log.V(1).Info("Container runtime selected (non-installed runtimes are expected and can be ignored)", | ||||||||||||||||
|
||||||||||||||||
| log.V(1).Info("Container runtime selected (non-installed runtimes are expected and can be ignored)", | |
| logMessage := "Container runtime selected" | |
| if runtimeFlagValue == flags.UnknownRuntime { | |
| logMessage = "Container runtime selected (non-installed runtimes are expected and can be ignored)" | |
| } | |
| log.V(1).Info(logMessage, |
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.
Let's not change the properties here: Runtime and Status conveys what we need. Just change the message to "Container runtime selected" (that's it, no need to elaborate beyond that).
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,8 +44,8 @@ type ideConnectionInfo struct { | |
| } | ||
|
|
||
| func NewIdeConnectionInfo(lifetimeCtx context.Context, log logr.Logger) (*ideConnectionInfo, error) { | ||
| const runnerNotAvailable = "Executables cannot be started via IDE: " | ||
| const missingRequiredEnvVar = "missing required environment variable '%s'" | ||
| const runnerNotAvailable = "IDE execution is not configured (this is expected in non-IDE environments): " | ||
|
Collaborator
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. No, let's not change this error message. Requesting IDE execution is NOT expected in non-IDE environments and represents an invalid workload definition. Just keep the error message as-is. |
||
| const missingRequiredEnvVar = "environment variable '%s' is not set" | ||
|
Collaborator
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. No, let's keep the message as-is. The part that the environment variable is REQUIRED is important. |
||
|
|
||
| createAndLogError := func(format string, a ...any) error { | ||
| err := fmt.Errorf(format, a...) | ||
|
|
||
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.
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.
If the execution gets to this place in the code, we know that there is more than one startup state to be tried, so "will try next stage if available" part is both redundant and bit misleading.