Closed argv-minus-one closed 4 years ago
Merging #33 into master will decrease coverage by
0.57%
. The diff coverage is0.00%
.
@@ Coverage Diff @@
## master #33 +/- ##
==========================================
- Coverage 42.24% 41.67% -0.58%
==========================================
Files 8 8
Lines 658 667 +9
==========================================
Hits 278 278
- Misses 380 389 +9
Impacted Files | Coverage Δ | |
---|---|---|
src/build.rs | 0.00% <ø> (ø) |
|
src/config.rs | 0.00% <ø> (ø) |
|
src/error.rs | 0.00% <ø> (ø) |
|
src/file.rs | 65.36% <0.00%> (-0.52%) |
:arrow_down: |
src/terminal.rs | 0.00% <0.00%> (ø) |
|
src/types.rs | 21.34% <0.00%> (-0.75%) |
:arrow_down: |
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 a51d1fa...052f981. Read the comment docs.
Makes various items
#[non_exhaustive]
. Fixes #32.Compatibility
⚠ This is a breaking change. In particular, code that constructs a
FileLoggerConfig
,TerminalLoggerConfig
, orKVFilterParameters
will need to be changed to use thenew
method on these types.⚠ This raises the minimum supported Rust version of this crate to 1.40, which is fairly recent (December 2019).
Changes Made
Items Made Non-Exhaustive
LoggerBuilder
,LoggerConfig
This makes it non-breaking to add more logging destinations in the future.
ErrorKind
This makes it non-breaking to add more specific kinds of errors in the future.
file::FileLoggerConfig
,terminal::TerminalLoggerConfig
This makes it non-breaking to add more configuration settings to these loggers (but see “Non-Exhaustive
struct
s” below).types::KVFilterParameters
Made non-exhaustive because
slog_kvfilter::KVFilter
is effectively non-exhaustive (its fields are all private).types::Format
,types::SourceLocation
These could conceivably have more variants added at some point.
types::OverflowStrategy
Made non-exhaustive because
slog_async::OverflowStrategy
is non-exhaustive.Items Not Made Non-Exhaustive
null::NullLoggerBuilder
,null::NullLoggerConfig
A logger that does nothing will probably never need configuration.
types::Severity
Not non-exhaustive because
slog::Level
is not non-exhaustive.types::TimeZone
I'm not sure whether you intend to support using specific time zones (besides UTC and the local time zone) in the future, so I've left this one alone.
Non-Exhaustive
struct
sNote that marking a
struct
as non-exhaustive changes how to construct it. Instead of using the traditionalStruct { .. }
syntax, a constructor method must be used.I've marked three
struct
s non-exhaustive:FileLoggerConfig
,TerminalLoggerConfig
, andKVFilterParameters
. I've added anew
method to each of them.Rustdoc generates a short explanation of non-exhaustive
struct
s. I've added a longer explanation to the documentation forKVFilterParameters
, since that one seems meant to be constructed by hand, whereas the other two seem meant to be constructed by serde.