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

structured logging: replacing Fatal/Exit/etc. without loss of flushing #303

Merged
merged 1 commit into from Mar 14, 2022

Commits on Mar 14, 2022

  1. structured logging: replacing Fatal/Exit/etc. without loss of flushing

    When structured logging called for functions like Fatal and Exit to be avoided
    in favor of klog.ErrorS + os.Exit, it was overlooked that this replacement
    skips flushing.
    
    We could ask developers to use klog.ErrorS + klog.Flush + os.Exit, but that is
    still not quite the same because klog.Flush could get stuck or take too long.
    Therefore klog now supports flushing + exiting with a dedicated function that
    can be combined with some other, arbitrary logging function.
    
    Allowing applications to change the default timeout and how specifically the
    application terminates may be useful, so both values are variables that are
    exported and users of klog are allowed to change.
    pohly committed Mar 14, 2022
    Copy the full SHA
    56b8a4e View commit details
    Browse the repository at this point in the history