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

Use same call depth for Enabled, Info, Error #218

Merged
merged 1 commit into from
Sep 4, 2023

Commits on Sep 4, 2023

  1. Use same call depth for Enabled, Info, Error

    klog does stack unwinding in `LogSink.Enabled` to implement per-source code
    verbosity thresholds (`-vmodule`). This worked for `logger.Info` and
    `logger.Error` because the code was written such that it matches how logr is
    implemented (Logger.Info -> Logger.Enabled -> LogSink.Enabled).
    
    It did not work for direct calls (`if logger.Enabled`) because then the call
    chain is `Logger.Enabled -> LogSink.Enabled`.  Now it uses the same
    depth (as passed to LogSink.Init) for all paths to Enabled.
    pohly authored and thockin committed Sep 4, 2023
    Configuration menu
    Copy the full SHA
    af7b2b7 View commit details
    Browse the repository at this point in the history