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

Fix LogDestination's Logger conformance log level filtering 🪵 #248

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

p4checo
Copy link
Member

@p4checo p4checo commented Jan 5, 2022

Checklist

Motivation and Context

When Logger conformance was added to LogDestination, we forgot to filter logs according to the destination's minLevel, causing all logs to be logged regardless of the level.

Description

  • Add log level filtering to LogDestination's Logger conformance, as well as relevant UTs.

  • Rename Log.Level.isAbove(minLevel:) helper to meets(minLevel:).

When `Logger` conformance was added to `LogDestination`, we forgot to
filter logs according to the destination's `minLevel`, causing all logs
to be logged regardless of the level.

## Changes

- Add log level filtering to `LogDestination`'s `Logger` conformance,
as well as relevant UTs.

- Rename `Log.Level.isAbove(minLevel:)` helper to `meets(minLevel:)`.
@p4checo p4checo requested a review from a team January 5, 2022 14:59
@p4checo p4checo changed the title Fix LogDestinations Logger conformance log level filtering 🪵 Fix LogDestination's Logger conformance log level filtering 🪵 Jan 5, 2022
@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #248 (b142c57) into master (21f56cb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #248   +/-   ##
=======================================
  Coverage   94.96%   94.97%           
=======================================
  Files          99       99           
  Lines        3280     3281    +1     
=======================================
+ Hits         3115     3116    +1     
  Misses        165      165           
Impacted Files Coverage Δ
Sources/Logging/Log.swift 100.00% <100.00%> (ø)
Sources/Logging/Loggers/Log+MultiLogger.swift 97.36% <100.00%> (ø)
Sources/Logging/Loggers/Logger.swift 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21f56cb...b142c57. Read the comment docs.

@p4checo p4checo merged commit a1b58a2 into master Jan 5, 2022
@p4checo p4checo deleted the fix-log-destination-logger-level-filtering branch January 5, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants