feat: WithLogger ContainerCustomizer support#2259
Merged
mdelapenya merged 2 commits intotestcontainers:mainfrom Mar 1, 2024
stevenh:feat/request-logger
Merged
feat: WithLogger ContainerCustomizer support#2259mdelapenya merged 2 commits intotestcontainers:mainfrom stevenh:feat/request-logger
mdelapenya merged 2 commits intotestcontainers:mainfrom
stevenh:feat/request-logger
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
mdelapenya
reviewed
Feb 22, 2024
mdelapenya
reviewed
Feb 22, 2024
Add support to use WithLogger as a ContainerCustomizer so that callers have an easy way to configure the logger of a container. Add tests for WithLogger. Validate Logger and LoggerOption implement the required interfaces.
mdelapenya
reviewed
Feb 23, 2024
Add a note about WithLogger being used before other functions so it can capture any logging they may generate. Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya
approved these changes
Mar 1, 2024
Member
mdelapenya
left a comment
There was a problem hiding this comment.
LGTM, thanks for adding this customisation of the container request!
mdelapenya
added a commit
to jespino/testcontainers-go
that referenced
this pull request
Mar 1, 2024
* main: chore: bump Go version to 1.21 (testcontainers#2292) chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 (testcontainers#2226) feat: WithLogger ContainerCustomizer support (testcontainers#2259) chore(deps): bump github.com/jackc/pgx/v5 in /modules/cockroachdb (testcontainers#2217) Move the file and mounts tests into a test package (testcontainers#2270) Fix Dockerfile not located when added to dockerignore (testcontainers#2272)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add support to use
WithLoggeras aContainerCustomizerso that callers have an easy way to configure the logger of a container.Add tests for
WithLogger.Validate
LoggerandLoggerOptionimplement the required interfaces.Also fix a comment typo and remove an unneeded return.
Why is it important?
Allows users to easily configure container loggers which is useful when using modules e.g. postgres or redis.
How to test this PR
go test -run=^TestWithLogger$