use slog::Drain;
use slog::Logger;
use slog::Never;
use slog::SendSyncRefUnwindSafeDrain;
use slog::SendSyncUnwindSafeDrain;
use slog_async::Async;
use super::into_logger;
use super::Config;
use super::Opts;
#[allow(clippy::needless_pass_by_value)]
pub fn async_flush<D>(config: Config, opts: &Opts, drain: D) -> Logger
where
D: 'static
+ SendSyncUnwindSafeDrain<Ok = (), Err = Never>
+ SendSyncRefUnwindSafeDrain<Ok = (), Err = Never>,
{
if config.async_flush {
into_logger(
opts,
Async::new(drain).build().ignore_res(),
config.include_version,
)
} else {
into_logger(opts, drain, config.include_version)
}
}