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

logger: Check level before creating entry #771

Merged
merged 1 commit into from Dec 18, 2019
Merged

logger: Check level before creating entry #771

merged 1 commit into from Dec 18, 2019

Commits on Dec 10, 2019

  1. logger: Check level before creating entry

    Calling `time.Now()` and creating an entry is unnecessary
    if the underlying core has the specified level disabled.
    
    To reduce the cost of logs at disabled levels, skip entry
    creation if the log level is disabled in the core.
    
    This special logic does not apply to DPanic or higher logs as
    they may need to panic/exit even if the entry does not cause
    any log to be emitted.
    
    On my machine, disabled debugging logs are 6x (~60ns to ~10ns).
    
    Fixes #770.
    prashantv committed Dec 10, 2019
    Copy the full SHA
    18e55c5 View commit details
    Browse the repository at this point in the history