Skip to content
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 9 commits into from
Mar 6, 2023

Commits on Mar 3, 2023

  1. 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.
    mark-rushakoff committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    184cf7f View commit details
    Browse the repository at this point in the history
  2. 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.
    mark-rushakoff committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    78c36d5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    daac2a9 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2023

  1. Configuration menu
    Copy the full SHA
    421c1e8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb94921 View commit details
    Browse the repository at this point in the history
  3. 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.
    mark-rushakoff committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    d70b3bb View commit details
    Browse the repository at this point in the history
  4. chore: fix missed test updates for logger API change

    I missed this earlier due to the linux build tag.
    mark-rushakoff committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    6ad0bac View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0a13f69 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    156e676 View commit details
    Browse the repository at this point in the history