rust-lang / log

Logging implementation for Rust
https://docs.rs/log
Apache License 2.0
2.16k stars 250 forks source link

Please `impl` Log for `Vec<T>` where `T: Log`, so that multiple parallel loggers can be set #537

Closed Boscop closed 8 months ago

Boscop commented 1 year ago

Please impl Log for Vec<T> where T: Log, so that multiple parallel loggers can be set.

In my use case, I need to log in parallel to multiple loggers that are imported from different crates.

KodrAus commented 1 year ago

Hi @Boscop :wave:

This seems like something you could reasonably implement yourself in a wrapper type. In general, I think we should avoid generic implementations in this library that layer any semantics over just a smart pointer.

ckane commented 1 year ago

You might want to look at https://docs.rs/simplelog/latest/simplelog/struct.CombinedLogger.html

Thomasdezeeuw commented 8 months ago

Seems to solved in an external crate, so closing.