Skip to content

feat: logging flags for configurable logging in the CLI#83

Merged
jakobmoellerdev merged 8 commits into
open-component-model:mainfrom
jakobmoellerdev:logging-flag
Apr 29, 2025
Merged

feat: logging flags for configurable logging in the CLI#83
jakobmoellerdev merged 8 commits into
open-component-model:mainfrom
jakobmoellerdev:logging-flag

Conversation

@jakobmoellerdev

Copy link
Copy Markdown
Member

What this PR does / why we need it

Eventually there will be commands that will not want to output debug logging all the time. Thus the default level should change and we should have configurable logging setup via flags. (think of a generic get cv that shouldnt output all fetch logs from plugins or the OCI implementation)

Which issue(s) this PR fixes

fix open-component-model/ocm-project#474

```
// Usage examples:
//
//	--logformat json     # Output logs in JSON format for machine processing
//	--logformat text     # Output logs in human-readable text format
//	--loglevel debug     # Show all logs including debug information
//	--loglevel info      # Show informational messages and above
//	--loglevel warn      # Show warnings and errors only (default)
//	--loglevel error     # Show errors only
//	--logoutput stdout   # Write logs to standard output
//	--logoutput stderr   # Write logs to standard error
```
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner April 29, 2025 07:03
@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/m Medium labels Apr 29, 2025
@github-actions github-actions Bot added area/documentation Documentation related size/l Large and removed size/m Medium labels Apr 29, 2025
Comment thread cli/cmd/root.go Outdated
Comment thread cli/cmd/root.go Outdated
Comment thread docs/reference/cli/ocm_completion_fish.md Outdated
Skarlso
Skarlso previously approved these changes Apr 29, 2025

@Skarlso Skarlso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions, otherwise LGTM

Comment thread cli/cmd/root.go
Comment thread cli/log/flag.go
@jakobmoellerdev jakobmoellerdev merged commit 4fafae2 into open-component-model:main Apr 29, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Documentation related kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a generic Logging Flag that can be used to control log levels of the CLI to supress verbose logs for structured outputs

3 participants