docs: compose logs update#13803
Conversation
Signed-off-by: aevesdocker <allie.sadler@docker.com>
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
This is a minor documentation update that adds cross-references to docker container logs --since / --until formats. The change is applied consistently across all three changed files (cmd/compose/logs.go, docs/reference/compose_logs.md, docs/reference/docker_compose_logs.yaml). No issues found.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)") | ||
| flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)") | ||
| flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes). Accepts the same formats as `docker container logs --since`.") | ||
| flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes). Accepts the same formats as `docker container logs --until`.") |
There was a problem hiding this comment.
Do we want to add this all in the flag description? I think we could have some alternatives here; if we add an Examples header in the markdown, and a header that has the right anchor, the docs should create a link to the flag description (similar to https://github.com/docker/cli/blob/v29.5.2/docs/reference/commandline/container_logs.md)
An alternative is to set the ExternalURL annotation; that would allow the docs to link to an alternative URL, which can be pointing to the corresponding flag for docker container logs;
https://github.com/docker/cli-docs-tool/blob/7543983fe39fcedd9182dfbee8824375999f8add/annotation/annotation.go#L19-L20
For an example, see https://github.com/docker/cli/blob/ad776d1e107b0d1cb3559a9c6b6391e11c3c51de/cli/command/image/build.go#L118-L119
flags.Var(&options.buildArgs, "build-arg", "Set build-time variables")
flags.SetAnnotation("build-arg", annotation.ExternalURL, []string{"https://docs.docker.com/reference/cli/docker/buildx/build/#build-arg"})There was a problem hiding this comment.
Looks like we still have work to do on the CLI documentation for the accepted formats though https://docs.docker.com/reference/cli/docker/container/logs/#until
(I recall there were some formats that worked, but not intentional, so we need to a tread carefully which formats we want to document).
|
Gave it a quick go with my suggestions; I'm also opening a PR in docker/cli to allow linking to the other flags (but this will require those changes to be published to docs.docker.com first); |
What I did
Minor docs update. Closes docker/docs#20712
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did