Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information