-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
refactor(log): require destination in calls to NewLogger #15262
Merged
Merged
Commits on Mar 3, 2023
-
refactor(log): allow selection of log output destination
Prior to this change, NewLogger defaulted to sending logs to os.Stdout. This change updates the method to accept an io.Writer indicating where logs should go, so that consumers of the SDK could choose to send logs to stderr, as that is the more typical IO stream for logs. This is a temporary commit that changes the NewLogger signature but adds a NewLoggerToStdout function. The next commit will remove NewLoggerToStdout (preferring NewLogger(os.Stdout) and update the referenced version of the log module.
Configuration menu - View commit details
-
Copy full SHA for 184cf7f - Browse repository at this point
Copy the full SHA 184cf7fView commit details -
refactor(log): require destination in NewLogger
Prior to this change, log.NewLogger() was hardcoded to write to stdout. This is not always desirable: depending on where the logger is instantiated, it may need to be associated with a (*cobra.Command)'s out or err stream, or importers of the SDK may want to send logs to stderr instead of stdout. Additionally, this removes any ambiguity about where logs may go, when reading the code. Finally, this allows an easy migration to defaulting logs to stderr, should we choose to do that in the future.
Configuration menu - View commit details
-
Copy full SHA for 78c36d5 - Browse repository at this point
Copy the full SHA 78c36d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for daac2a9 - Browse repository at this point
Copy the full SHA daac2a9View commit details
Commits on Mar 6, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 421c1e8 - Browse repository at this point
Copy the full SHA 421c1e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb94921 - Browse repository at this point
Copy the full SHA cb94921View commit details -
Use intermediate SDK commit from #15262
There were CI failures due to depending on a mismatched pairing of the log module and the main SDK module.
Configuration menu - View commit details
-
Copy full SHA for d70b3bb - Browse repository at this point
Copy the full SHA d70b3bbView commit details -
chore: fix missed test updates for logger API change
I missed this earlier due to the linux build tag.
Configuration menu - View commit details
-
Copy full SHA for 6ad0bac - Browse repository at this point
Copy the full SHA 6ad0bacView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a13f69 - Browse repository at this point
Copy the full SHA 0a13f69View commit details -
Configuration menu - View commit details
-
Copy full SHA for 156e676 - Browse repository at this point
Copy the full SHA 156e676View commit details
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.