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

output: handle WithName like zapr does #391

Merged
merged 1 commit into from
Oct 26, 2023

Commits on Oct 26, 2023

  1. output: handle WithName like zapr does

    Previously, all names set via `WithNames` were concatenated with / and added to
    the main message string as a `<names>: <msg>` prefix. Now klog in all of its
    incarnations (internal logger in klog, klogr, textlogger) behaves like zapr and
    adds a "logger" key with the names concatenated by a dot as value.
    
    The main advantage, besides consistency, is that code which does a full string
    match against some message string still works even when contextual logging is
    enabled and `WithName` is used, at least as long as that code doesn't also
    match all key/value pairs.
    pohly committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    009a04a View commit details
    Browse the repository at this point in the history