feat: add combined logs command - #189
Open
galargh wants to merge 1 commit into
Open
Conversation
galargh
force-pushed
the
galargh/add-logs-command
branch
from
August 30, 2026 11:50
800a404 to
ed13f05
Compare
galargh
force-pushed
the
galargh/add-logs-command
branch
from
September 4, 2026 21:50
ed13f05 to
270d2de
Compare
galargh
marked this pull request as ready for review
September 4, 2026 22:53
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.
Related to #126
This PR adds
foc-devnet logsto print combined logs from all containers in the active devnet run.It supports
--follow / -fand--tail / -tflags, similar todocker logsfor example, for live log tailing (the latter can only be supplied if follow mode is on; it prints N lines per-container before starting the follow). Each line in the output is prefixed with timestamp and container name for easier cross-service debugging.Details
docker logs --timestamps, merges entries from all current-run containers, and sorts by timestamp.docker logs --followstream per current-run container and prefixes output as it arrives.foc-*containers.Testing
cargo fmt --checkcargo testcargo run -- logs --helpFIX=0 ./scripts/lint.shI also run a tiny smoke test:
Set
FOC_DEVNET_BASEDIRto a local ignored directory.Write a fake
current_runid.jsonwith run ID 20260904T1200_LogSmoke.Start two simple Docker containers named with that run prefix:
*Each container prints one stdout and one stderr line every second.
Run
cargo run -- logs --follow --tail 5which discovers those containers by current run ID prefix and follows their logs.Result: