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

refactor(cli): replace log with logrus for structured logging. Fixes #2308 #3447

Closed
wants to merge 2 commits into from
Closed

refactor(cli): replace log with logrus for structured logging. Fixes #2308 #3447

wants to merge 2 commits into from

Conversation

suzuki-shunsuke
Copy link
Contributor

@suzuki-shunsuke suzuki-shunsuke commented Jul 10, 2020

This pull request just replaces the standard package log to logrus for structured logging.

#2308

All log package is replaced.

$ ag '"log"'   
cmd/argo/commands/submit.go
97:	command.Flags().BoolVar(&cliSubmitOpts.log, "log", false, "log the workflow until it completes")

cmd/argo/commands/retry.go
79:	command.Flags().BoolVar(&cliSubmitOpts.log, "log", false, "log the workflow until it completes")

workflow/common/util.go
94:		SubResource("log").

pkg/apiclient/workflow/workflow.pb.gw.go
1769:	pattern_WorkflowService_PodLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"api", "v1", "workflows", "namespace", "name", "podName", "log"}, "", runtime.AssumeColonVerbOpt(true)))

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed the CLA.
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@suzuki-shunsuke suzuki-shunsuke changed the title chore(log): replace log to logrus for structured logging chore(log): replace log to logrus for structured logging. Fixes #2308 Jul 10, 2020
@alexec
Copy link
Contributor

alexec commented Jul 10, 2020

I think "structured logging" might mean something different to you. For me it essentially means using log.Fields{} so that logs can be easily queried in Splunk.

@alexec
Copy link
Contributor

alexec commented Jul 10, 2020

Looks great so far!

        --- FAIL: TestCLIWithServerSuite/TestTemplate/Get (0.06s)
            cli_test.go:667: 
                	Error Trace:	cli_test.go:667
                	            				given.go:179
                	            				cli_test.go:665
                	            				suite.go:77
                	Error:      	"time=\"2020-07-10T14:46:47Z\" level=fatal msg=\"rpc error: code = NotFound desc = workflowtemplates.argoproj.io \\\"not-found\\\" not found\"\n" does not contain "\"not-found\" not found"

There are failing tests that need to be fixed.

@alexec alexec self-assigned this Jul 10, 2020
@suzuki-shunsuke
Copy link
Contributor Author

Thank you for your review.
I found my misunderstanding.

The code changed in this pull request is for CLI tool, but #2808 intends to change the logging of the server side.
logrus is already used at the server side, but #2808 means that the fields are insufficient.

@suzuki-shunsuke suzuki-shunsuke deleted the feat/replace-log-to-logrus branch July 11, 2020 06:08
@agilgur5 agilgur5 added the area/cli The `argo` CLI label Feb 10, 2024
@agilgur5 agilgur5 changed the title chore(log): replace log to logrus for structured logging. Fixes #2308 refactor(cli): replace log to logrus for structured logging. Fixes #2308 Feb 10, 2024
@agilgur5 agilgur5 changed the title refactor(cli): replace log to logrus for structured logging. Fixes #2308 refactor(cli): replace log with logrus for structured logging. Fixes #2308 Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants