feat: add log helpers with options, separated stdout/stderr#656
Merged
Conversation
Change Logs() to return LogResult{StdOut, StdErr} with Combined() helper,
matching the ExecResult pattern. Add functional options: WithTail,
WithLogsSince, WithLogsUntil, WithTimestamps. This bridges the gap from
v3's LogsOptions while keeping the API simple—streaming/Follow is left
to Pool.Client() escape hatch.
https://claude.ai/code/session_01HNrzQQdiiwY44DYNZpDmqn
|
|
Adds FollowLogs(ctx, stdout, stderr, ...LogOption) to the Resource interface and *resource, enabling callers to tail container logs until context cancellation or container exit — the idiomatic way to implement readiness detection via log output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cover the new log helper API introduced in the previous two commits:
- LogResult.Combined() unit tests (value and empty)
- Logs()/FollowLogs() return ErrClientClosed when no pool
- Integration: stdout/stderr separation via Logs()
- Integration: WithTail("1") limits output to last line
- Integration: FollowLogs streams until container exits
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Change Logs() to return LogResult{StdOut, StdErr} with Combined() helper,
matching the ExecResult pattern. Add functional options: WithTail,
WithLogsSince, WithLogsUntil, WithTimestamps. This bridges the gap from
v3's LogsOptions while keeping the API simple—streaming/Follow is left
to Pool.Client() escape hatch.
https://claude.ai/code/session_01HNrzQQdiiwY44DYNZpDmqn