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

add Format wrapper #374

Merged
merged 1 commit into from
Apr 24, 2023
Merged

add Format wrapper #374

merged 1 commit into from
Apr 24, 2023

Commits on Apr 12, 2023

  1. add Format wrapper

    The wrapper function solves two problems:
    - Types which inherit a String implementation from some embedded type
      and then don't overwrite it log just the embedded type as string.
      Example: KubeletConfig.
    - Types which have a generated String implementation and no MarshalLog
      get always logged as string, also in JSON. Example: all of the
      Kubernetes API types.
    
    Ideally, types should get fixed to handle both cases. klog.Format is the
    fallback for cases where that is not possible or not desirable: it implements
    String as an indented JSON dump and MarshalLog as value dump through
    reflection.
    pohly committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    deffe14 View commit details
    Browse the repository at this point in the history