kraken_async_rs/test_support/
logging.rsuse std::fs::File;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::{fmt, Registry};
pub fn set_up_logging(filename: &str) {
let subscriber = Registry::default()
.with(
fmt::Layer::default()
.with_ansi(false)
.with_writer(get_log_file(filename)),
)
.with(fmt::Layer::default().pretty().with_writer(std::io::stdout));
tracing::subscriber::set_global_default(subscriber).unwrap();
}
fn get_log_file(filename: &str) -> File {
File::options()
.append(true)
.create(true)
.open(filename)
.expect("failed to open test log file!")
}