Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kubernetes/klog
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.90.0
Choose a base ref
...
head repository: kubernetes/klog
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.90.1
Choose a head ref
  • 12 commits
  • 14 files changed
  • 4 contributors

Commits on Jan 24, 2023

  1. klog: support writing formatted buffer through logger

    This is meant to be used with textlogger for the non-structured log calls to
    avoid double encoding.
    pohly committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    81f97ff View commit details
    Browse the repository at this point in the history
  2. textlogger: write unstructured klog output directly

    Textlogger can (but doesn't have to) be used to write klog's unstructured
    output from calls like Infof directly to the output stream. This has two
    advantages:
    - traditional output remains exactly the same as before, which is particularly
      important for multi-line messages because those get quoted otherwise
    - performance is better because re-encoding the output string is avoided
    pohly committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    7a9f099 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2023

  1. ktesting: use klog-like header

    In practice, replacing normal klog text output with ktesting lost the time
    stamps. This is perhaps not important for unit tests, but for benchmarking
    those can be crucial.
    
    Now ktesting uses a stripped down klog header:
    - The source code location comes first, because
      that is printed by the testing package.
    - Instead if INFO and ERROR, the short I and E are used.
    - The useless tid/pid part isn't present.
    
    Example:
    
        $ go test -v ./ktesting/example/
        === RUN   TestKlogr
            example_test.go:45: I0201 17:58:36.235936] hello world
            example_test.go:46: E0201 17:58:36.236052] failed err="failed: some error"
            example_test.go:47: I0201 17:58:36.236086] verbosity 1
            example_test.go:48: I0201 17:58:36.236110] main/helper: with prefix
            example_test.go:50: I0201 17:58:36.236154] key/value pairs int=1 float=2 pair="(1, 2)" raw={Name:joe NS:kube-system} kobj="kube-system/joe"
            example_test.go:57: I0201 17:58:36.236187] info message level 4
            example_test.go:58: I0201 17:58:36.236209] info message level 5
        --- PASS: TestKlogr (0.00s)
        PASS
    pohly committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    8b4cfd2 View commit details
    Browse the repository at this point in the history
  2. ktesting: capture log entries only if requested

    Most users won't need this feature. It was enabled by default to keep the API
    simple and because the primary goal was unit testing, but benchmarks also need
    this and there unnecessary overhead needs to be avoided.
    pohly committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    d113925 View commit details
    Browse the repository at this point in the history
  3. buffer: restore dropping of too large buffers

    This was removed when introducing sync.Pool in commit
    1a1367c because it seemed unnecessary, but an
    open issue about the sync.Pool documentation shows that a size limit may be
    useful after all.
    pohly committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    2582956 View commit details
    Browse the repository at this point in the history
  4. ktesting: allow overriding default formatter

    The intended usage is to replace fmt.Sprintf("%+v") with gomega.format.Object +
    YAML support, therefore the only public API change is in the (still
    experimental) ktesting.
    
    Internally the additional function pointer gets passed through via a new
    Formatter struct. To minimize the impact on klog and textlogger, the
    package-level functions still exist and use an empty Formatter.
    pohly committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    1b27ee8 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2023

  1. Merge pull request #366 from pohly/buffer-size-limit

    buffer: restore dropping of too large buffers
    k8s-ci-robot authored Feb 3, 2023
    Configuration menu
    Copy the full SHA
    af72dbd View commit details
    Browse the repository at this point in the history
  2. Merge pull request #365 from pohly/ktesting-timestamps

    ktesting improvements
    serathius authored Feb 3, 2023
    Configuration menu
    Copy the full SHA
    90cff0f View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2023

  1. ktesting: support verbosity changes at runtime

    Being able to change the verbosity at runtime is useful. It is already
    supported by the underlying code, ktesting and its Config struct just didn't
    expose it.
    pohly committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    e092d89 View commit details
    Browse the repository at this point in the history
  2. textlogger: verbosity changes through public API

    By embedding *verbosity.VState in Config, users of the package
    already had access to V and VModule, but that had two drawbacks:
    - not easy to discover
    - unclean separate between internal and external API
    
    Providing explicit functions is better.
    pohly committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    a0fea0c View commit details
    Browse the repository at this point in the history
  3. Merge pull request #368 from pohly/ktesting-config-api

    ktesting + textlogger config api
    serathius authored Feb 9, 2023
    Configuration menu
    Copy the full SHA
    e37f9fe View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2023

  1. Merge pull request #363 from pohly/textlogger-backend

    textlogger write through
    k8s-ci-robot authored Mar 1, 2023
    Configuration menu
    Copy the full SHA
    d7fc505 View commit details
    Browse the repository at this point in the history
Loading