Skip to content

Commit

Permalink
Add container logging
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Aug 8, 2024
1 parent 8772002 commit 4824984
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/utils/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ use std::{
Arc,
},
};
use testcontainers::{runners::AsyncRunner, ContainerAsync, ImageExt};
use testcontainers::{
core::logs::consumer::logging_consumer::LoggingConsumer, runners::AsyncRunner, ContainerAsync,
ImageExt,
};
use testcontainers_modules::{nats::Nats, postgres::Postgres};
use tokio::net::TcpListener;
use tracing::level_filters::LevelFilter;
Expand Down Expand Up @@ -72,6 +75,7 @@ async fn setup_database() -> (ContainerAsync<Postgres>, DbConn) {
let container = Postgres::default()
.with_name(format!("{REGISTRY}/library/postgres"))
.with_tag("16")
.with_log_consumer(LoggingConsumer::new())
.start()
.await
.unwrap();
Expand Down

0 comments on commit 4824984

Please sign in to comment.