message: subscriber: Added BoxMakeWriter.
  ## Motivation
  See context from
  This
  should unblock the effort to land an appender that can write the same
  log line to multiple writers.
  ## Solution
  Implement `BoxMakeWriter` as suggested by in the above thread.
diff: //!
  //! [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
  -use std::io;
  +use io::Write;
  +use std::{fmt::Debug, io};
  /// A type that can create [`io::Write`] instances.
  ///
  @@ -103,6 +104,80 @@ impl MakeWriter for TestWriter {
  }
  }
  +/// A writer that erases the specific [`io::Write`] and [`Makewriter`] types being used.
  +///
  +/// This is useful in cases where the concrete type of the writer cannot be known
  +/// until runtime.
  +///
  +/// # Examples
  +///
  +/// A function that returns a [`Subscriber`] that will write to either stdout or stderr:
  +///
  +/// ```rust
  +/// # use tracing::Subscriber;
  +/// # use tracing_subscriber::fmt::writer::BoxMakeWriter;
  +///
  +/// fn dynamic_writer(use_stderr: bool) -> impl Subscriber {
  +/// let writer = if use_stderr {
  +/// BoxMakeWriter::new(std::io::stderr)
  +/// } else {
  +/// BoxMakeWriter::new(std::io::stdout)
  +/// };
  +///
  +/// tracing_subscriber::fmt().with_writer(writer).finish()
  +/// }
  +/// ```
  +///
  +/// [`MakeWriter`]: trait.MakeWriter.html
  +/// [`Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html
  +/// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
  +pub struct BoxMakeWriter {
  + inner: Box<dyn MakeWriter<Writer = Box<dyn Write>> + Send + Sync>,
  +}
  +
  +impl BoxMakeWriter {
  + /// Constructs a `BoxMakeWriter` wrapping a type implementing [`MakeWriter`].
  + ///
  + /// [`MakeWriter`]: trait.MakeWriter.html
  + pub fn new<M>(make_writer: M) -> Self
  + where
  + M: MakeWriter + Send + Sync + 'static,
  + M::Writer: Write + 'static,
  + {
  + Self {
  + inner: Box::new(Boxed(make_writer)),
  + }
  + }
  +}
  +
  +impl Debug for BoxMakeWriter {
  + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  + f.pad("BoxMakeWriter { ... }")
  + }
  +}
  +
  +impl MakeWriter for BoxMakeWriter {
  + type Writer = Box<dyn Write>;
  +
  + fn make_writer(&self) -> Self::Writer {
  + self.inner.make_writer()
  + }
  +}
  +
  +struct Boxed<M>(M);
  +
  +impl<M> MakeWriter for Boxed<M>
  +where
  + M: MakeWriter,
  + M::Writer: Write + 'static,
  +{
  + type Writer = Box<dyn Write>;
  +
  + fn make_writer(&self) -> Self::Writer {
  + Box::new(self.0.make_writer())
  + }
  +}
  +
  #[cfg(test)]
  mod test {
  use super::MakeWriter;
  