Streams container stdout/stderr to Elixir's Logger.
Attach via TestcontainerEx.Container.with_log_consumer/2 on the container config,
then call start_link/3 after the container is running.
Example
config =
TestcontainerEx.Container.new("postgres:15-alpine")
|> TestcontainerEx.Container.with_log_consumer(:debug)
{:ok, container} = TestcontainerEx.start_container(config)
Summary
Functions
Starts a linked task that streams container logs to Logger.
Functions
@spec start_link(String.t(), Req.Request.t(), Logger.level()) :: {:ok, pid()}
Starts a linked task that streams container logs to Logger.
Parameters
container_id— the Docker container IDconn— the Req connection to the Docker APIlevel— Logger level (:debug,:info,:warning,:error), default:debug