Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce logger to ctx, refactor cmd, and migrate logo to Zarf Say #3120

Merged
merged 10 commits into from
Oct 22, 2024

Conversation

mkcp
Copy link
Contributor

@mkcp mkcp commented Oct 18, 2024

Description

There's a bunch of changes in this one but they all intersect on the critical path of cmd.Root, so it made sense to batch them together. s/o to @eddiezane for logger.From() - I was going a little insane looking at the typecast pattern everywhere, this is much more elegant. I'm not 100% sold on adding the say Command to root in Execute(), ideally these would all be declared in the same space as the others, but I wanted to avoid introducing another init() and instead begin us on a better layout for cmd.

Also this adds --log-format and json is now supported as well as text.

Next steps are diving through commands one at a time and replacing the message logs with the new logger.

Related Issue

Relates to #2576

Checklist before merging

mkcp added 4 commits October 18, 2024 13:07
…ag, and adjust log levels

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
@mkcp mkcp added this to the v1.0.0-rc1 milestone Oct 18, 2024
@mkcp mkcp self-assigned this Oct 18, 2024
@mkcp mkcp requested review from a team as code owners October 18, 2024 23:08
Copy link

netlify bot commented Oct 18, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 00bde4c
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/6717df536dadd700083011a4

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 5.05051% with 188 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/root.go 0.00% 111 Missing ⚠️
src/cmd/say/say.go 0.00% 61 Missing ⚠️
src/cmd/cmd.go 0.00% 5 Missing ⚠️
src/cmd/common/viper.go 0.00% 5 Missing ⚠️
src/pkg/logger/logger.go 71.42% 4 Missing ⚠️
src/cmd/dev.go 0.00% 1 Missing ⚠️
src/cmd/package.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/cmd/initialize.go 0.00% <ø> (ø)
src/cmd/dev.go 0.00% <0.00%> (ø)
src/cmd/package.go 0.00% <0.00%> (ø)
src/pkg/logger/logger.go 93.33% <71.42%> (-2.32%) ⬇️
src/cmd/cmd.go 0.00% <0.00%> (ø)
src/cmd/common/viper.go 0.00% <0.00%> (ø)
src/cmd/say/say.go 0.00% <0.00%> (ø)
src/cmd/root.go 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
mkcp added 4 commits October 21, 2024 11:41
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
src/config/lang/english.go Outdated Show resolved Hide resolved
src/pkg/logger/logger.go Outdated Show resolved Hide resolved
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
@mkcp mkcp added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit 72769a9 Oct 22, 2024
26 checks passed
@mkcp mkcp deleted the mkcp/cmd-refactor branch October 22, 2024 18:21
Jneville0815 pushed a commit to radiusmethod/zarf that referenced this pull request Dec 12, 2024
… Say (zarf-dev#3120)

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants