-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Changed log.info to tidy up using fmt.sprintf #2246
Changes from 1 commit
86981e0
894f3cf
9b9bce9
3d06649
2fed3b3
d34bf29
681e441
bd4d60a
d3870fd
c0d9b5a
cc4ef7c
e2fc799
fa18fa6
155020f
24d80f5
10fae31
59819b5
f2c7fd3
d906611
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 |
---|---|---|
|
@@ -275,7 +275,8 @@ func getMaxWorkers(gvk schema.GroupVersionKind, defValue int) int { | |
maxWorkers, err := strconv.Atoi(os.Getenv(envVar)) | ||
if err != nil { | ||
// we don't care why we couldn't parse it just use default | ||
log.Info("Failed to parse %v from environment. Using default %v", envVar, defValue) | ||
//log.Info("Failed to parse %v from environment. Using default %v", envVar, defValue) | ||
camilamacedo86 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
log.Info(fmt.Sprintf("Using default value for workers %d", defValue)) | ||
camilamacedo86 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return defValue | ||
} | ||
|
||
|
@@ -297,7 +298,9 @@ func getAnsibleVerbosity(gvk schema.GroupVersionKind, defValue int) int { | |
)) | ||
ansibleVerbosity, err := strconv.Atoi(os.Getenv(envVar)) | ||
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. I think we should use the same logic for the ansible verbosity operator. Since the logic is identical, I think it would make sense to define a new function with this signature:
The call it for both |
||
if err != nil { | ||
log.Info("Failed to parse %v from environment. Using default %v", envVar, defValue) | ||
//log.Info("Failed to parse %v from environment. Using default %v", envVar, defValue) | ||
camilamacedo86 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
log.Info(fmt.Sprintf("Using default value for ansible verbosity %d", defValue)) | ||
camilamacedo86 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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. Nit: this extraneous empty line can be removed. |
||
return defValue | ||
} | ||
|
||
|
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.
No need to keep this line around anymore.
Ditto for ansibleVerbosity.