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

[VC-35738] Log with klog to stdout and stderr in Kubernetes text format #596

Merged
merged 12 commits into from
Oct 31, 2024

Commits on Oct 29, 2024

  1. Log with klog to stdout and stderr in JSON format

    Signed-off-by: Richard Wall <richard.wall@venafi.com>
    wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    e745fe0 View commit details
    Browse the repository at this point in the history
  2. logs_test.go: assert didn't make the test exit with 1, move to require

    For some reason, `assert.Equal` doesn't cause the test sub-process to
    exit with 1. Instead, it returns 0 which means we can't notice the error
    from the parent process.
    maelvls authored and wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    08d5e8c View commit details
    Browse the repository at this point in the history
  3. logs_test.go: assert the logs themselves

    That's useful to keep track what the logs look like, especially now that
    I'm trying to switch from plain klog to slog.
    maelvls authored and wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    dcca1b3 View commit details
    Browse the repository at this point in the history
  4. logs.go: move to slog and show the src (vcert or agent) of the logs

    Before, there was no way to know if a given log came from the VCert
    library or from the agent itself.
    
    I had to tweak logToSlogWriter's Writer to remove the extraneous "\n"
    that log.Printf prints.
    maelvls authored and wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    ba052e4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fda1d3e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e4bf7cb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d9bc223 View commit details
    Browse the repository at this point in the history
  8. logs.go: use --log-level instead of --v

    maelvls authored and wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    c39594a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f3b721e View commit details
    Browse the repository at this point in the history
  10. Set the default logging format to text

    Signed-off-by: Richard Wall <richard.wall@venafi.com>
    wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    6f8c52e View commit details
    Browse the repository at this point in the history
  11. Remove redundant test for vcert log prefix

    The exact logs output is now verified.
    
    Signed-off-by: Richard Wall <richard.wall@venafi.com>
    wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    73526f3 View commit details
    Browse the repository at this point in the history
  12. Fix some out-of-date comments

    Signed-off-by: Richard Wall <richard.wall@venafi.com>
    wallrj committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    54eb5a5 View commit details
    Browse the repository at this point in the history