feat: add func logs command to stream function logs#3669
feat: add func logs command to stream function logs#3669Itx-Psycho0 wants to merge 2 commits intoknative:mainfrom
Conversation
This adds a new 'func logs' command that streams logs from deployed functions, abstracting away the underlying service name and pod details. Features: - Stream logs for function in current directory - Stream logs by function name with --name flag - Filter logs by time with --since flag (e.g., 5m, 1h) - Support for custom namespace with --namespace flag - Graceful handling of Ctrl+C to stop log streaming The command uses the existing GetKServiceLogs functionality from the knative package, providing a user-friendly CLI interface for developers. Fixes knative#3521
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Itx-Psycho0 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Itx-Psycho0. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. 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-sigs/prow repository. |
|
I've implemented the func logs command as discussed in this issue. The implementation uses the Kubernetes logs API approach as suggested by @srikaryt2. The command provides a clean interface for streaming function logs without requiring users to know service names or pod details. It supports filtering by time and works with both local functions and functions specified by name. All tests pass and the implementation follows the existing command patterns in the codebase. Looking forward to your feedback. Thanks! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3669 +/- ##
==========================================
- Coverage 56.61% 47.66% -8.95%
==========================================
Files 181 181
Lines 20853 20963 +110
==========================================
- Hits 11806 9993 -1813
- Misses 7833 10062 +2229
+ Partials 1214 908 -306
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR implements the func logs command requested in issue #3521.
The command provides a simple way to stream logs from deployed functions without needing to know the underlying service name or pod details.
Usage examples:
Implementation details:
The command is added to the Development Commands group alongside run, invoke, and build commands.
Fixes #3521