Commit d6298cd
authored
subscriber: add
Depends on #1141.
This branch adds a `MakeWriterExt` trait which adds a number of
combinators for composing multiple types implementing `MakeWriter`.
`MakeWriter`s can now be teed together, filtered with minimum and
maximum levels, filtered with a `Metadata` predicate, and combined with
a fallback for when a writer is _not_ made for a particular `Metadata`.
I've also added a `MakeWriter` impl for `std::fs::File`, because `&File`
implements `Write`. Ideally, we'd have a default impl of `MakeWriter`
for `T where &T: Write`, but that's not possible due to the impl of
`MakeWriter` for `F: Fn() -> T: Write`. We could add a generic `by_ref`
adapter for any `T where &T: Write`, though...
Signed-off-by: Eliza Weisman <eliza@buoyant.io>MakeWriter combinators (#1274)1 parent 96eaaa0 commit d6298cd
2 files changed
+871
-17
lines changed
0 commit comments