simplify log printing in localstack start command #9166
Merged
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.
Motivation
An enterprise user noticed that when using
EXTENSION_DEV_MODE=1
is set, the information is not printed correctly to the logs when usinglocalstack start
.I couldn't really find the root cause, but it seems to have something to do with
echo
calls in the docker-entrypoint.sh not showing up in the default outfile, which is the mechanism we use to dump the docker logs.We then listen on those logs using a
FileListener
.That seemed a bit roundabout to me now that we have
stream_container_logs
, so I removed theFileListener
logic alltogether, and just wait for the container to start and then start printing the logs from there.Since
docker logs -f
prints all the previous logs, it's a pretty robust solution.I also found an issue where we didn't pass the
Container
instance to theLocalstackContainerServer
.Changes
FileListener
and replace it withContainerLogPrinter
localstack start
accordinglyLocalstackContainerServer
to also take aContainer
instance