Skip to content

Commit d6298cd

Browse files
authored
subscriber: add MakeWriter combinators (#1274)
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>
1 parent 96eaaa0 commit d6298cd

File tree

2 files changed

+871
-17
lines changed

2 files changed

+871
-17
lines changed

0 commit comments

Comments
 (0)