Add flag to prefix log lines with log source (task and step name) by default#2525
Add flag to prefix log lines with log source (task and step name) by default#2525tekton-robot merged 4 commits intotektoncd:mainfrom ab-ghosh:feature/tkn-p-logs
Conversation
…default Signed-off-by: Abhishek Ghosh <[email protected]>
|
Hi @abhishek-ghosh-codes. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm |
|
/test pull-tekton-cli-integration-tests |
|
/test pull-tekton-cli-build-tests |
|
Hi @abhishek-ghosh-codes, Thanks for the pull request, and can you please add a unit test? |
Signed-off-by: Abhishek Ghosh <[email protected]>
|
/retest |
|
@abhishek-ghosh-codes most of the "error" lines in the integration tests are red herrings I believe; they seem to be expected to fail but Prow doesn't render that very well. However it looks like the test diff --git c/test/e2e/pipeline/start_test.go i/test/e2e/pipeline/start_test.go
index f8ba360a5..b91b7fcce 100644
--- c/test/e2e/pipeline/start_test.go
+++ i/test/e2e/pipeline/start_test.go
@@ -78,7 +78,7 @@ func TestPipelineInteractiveStartE2E(t *testing.T) {
})
t.Run("Validate pipeline logs, with follow mode (-f) and --last ", func(t *testing.T) {
- res := tkn.Run(t, "pipeline", "logs", "--last", "-f")
+ res := tkn.Run(t, "pipeline", "logs", "--last", "-f", "--prefix=false")
expected := "\n\ntest-e2e\n\n"
helper.AssertOutput(t, expected, res.Stdout())
}) |
|
/retest-required |
Signed-off-by: Abhishek Ghosh <[email protected]>
|
/retest |
1 similar comment
|
/retest |
|
/lgtm |
|
@pratap0007: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm |
|
@vinamra28 Can you please review and merge this? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divyansh42, vinamra28 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#2548 | [dependabot[bot]] Bump the go-docker-dependencies group with 2 updates | 2025/05/30-06:18 #2544 | [vinamra28] Update CLI docs for tkn v0.41.0 | 2025/05/30-07:58 #2525 | [Abhishek Ghosh] Add flag to prefix log lines with log source (task and step name) by default | 2025/06/05-16:57 #2525 | [Abhishek Ghosh] updated the docs | 2025/06/05-16:57 #2525 | [Abhishek Ghosh] Add unit test scripts | 2025/06/05-16:57 #2525 | [Abhishek Ghosh] Adjust pipeline logs test to align with updated output format | 2025/06/05-16:57 #2549 | [dependabot[bot]] Bump the go-docker-dependencies group with 2 updates | 2025/06/10-10:07 #2553 | [Chmouel Boudjnah] fix: update Pending color of PipelineRunPending | 2025/06/11-14:51 #2552 | [dependabot[bot]] Bump github.com/cloudflare/circl from 1.3.7 to 1.6.1 | 2025/06/13-06:33 #2556 | [divyansh42] Fix deadlock issue when following logs | 2025/06/23-17:15 null | [dependabot[bot]] Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 in /tools | 2025/06/30-07:27 Signed-off-by: vinamra28 <[email protected]>
Changes
Added additional formatting options such as --prefix for tkn p logs, which prefixes each log line with the task name and step name to match the output format of tkn pr logs. This is done to resolve issue #2223 .
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make checkmake generatedSee the contribution guide
for more details.
Release Notes