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

zapcore: Add LevelOf(LevelEnabler), UnknownLevel #1147

Merged
merged 5 commits into from Aug 16, 2022
Merged

Commits on Aug 15, 2022

  1. zapcore: Add LevelOf(LevelEnabler), UnknownLevel

    Add a new function LevelOf that reports the minimum enabled log level
    for a LevelEnabler.
    
    This works by looping through all known Zap levels in-order,
    returning the newly introduced UnknownLevel if none of the known levels
    are enabled.
    
    A LevelEnabler or Core implementation may implement the `Level() Level`
    method to override and optimize this behavior.
    AtomicLevel already implemented this method.
    This change adds the method to all Core implementations shipped with
    Zap.
    
    Note:
    UnknownLevel is set at FatalLevel+1 to account for the possibility that
    users of Zap are using DebugLevel-1 as their own custom log level--even
    though this isn't supported, it's preferable not to break these users.
    Users are less likely to use FatalLevel+1 since Fatal means "exit the
    application."
    
    Resolves #1144
    Supersedes #1143, which was not backwards compatible
    abhinav committed Aug 15, 2022
    Copy the full SHA
    6087ffe View commit details
    Browse the repository at this point in the history
  2. level_enab => level_enabler

    abhinav committed Aug 15, 2022
    Copy the full SHA
    367c0ff View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    d5d409e View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    1a7cb65 View commit details
    Browse the repository at this point in the history
  5. Parallelize some tests

    abhinav committed Aug 15, 2022
    Copy the full SHA
    391e7b0 View commit details
    Browse the repository at this point in the history