slog
slog copied to clipboard
StdLog missing examples of correct usage
The documentation:
https://docs.rs/slog-stdlog/3.0.4-pre/slog_stdlog/struct.StdLog.html
lacks any examples. And a working example is very much necessary, because straightforward usage doesn't work and produces incomprehensible error. StdLog
implements Drain
, but one that is incompatible with slog::Logger
:
39 | let log = slog::Logger::root(slog_stdlog::StdLog, slog::o!());
| ^^^^^^^^^^^^^^^^^^ expected struct `std::io::Error`, found struct `slog::private::NeverStruct`
|
= note: expected type `std::io::Error`
found type `slog::private::NeverStruct`
= note: required by `slog::Logger::<D>::root`
I've tried calling .fuse()
, but it doesn't change error type to slog::private::NeverStruct
, just passes the same error type through.
.fuse()
should work. https://docs.rs/slog/2.4.1/slog/struct.Fuse.html type Error = Never
, no matter what's the wrapped type. The implementation: https://docs.rs/slog/2.4.1/src/slog/lib.rs.html#1902-1922 .
Are you sure it didn't?
Could you add examples please? :)
PRs are always welcome