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

Configure zapr logger to skip the caller #1239

Merged
merged 1 commit into from Dec 17, 2021

Conversation

palemtnrider
Copy link
Contributor

By skipping the caller, the output shows the calling function instead
of the logging wrapper.

Closes: #1238

What changed?
Added a skip caller option to the creation of the logger used in the API server.

Why?
By skipping the caller, the output shows the code making the call to the logger instead of the logger.

How did you test it?
I Ran gitops ui run and checked the output

Output now looks like -

2021-12-15T16:14:18.523-0700 INFO app/add.go:107 Adding application:
2021-12-15T16:14:18.523-0700 INFO app/add.go:108 Name: mypdi
2021-12-15T16:14:18.523-0700 INFO app/add.go:109 URL: ssh://git@github.com/palemtnrider/podinfo-deploy.git
2021-12-15T16:14:18.523-0700 INFO app/add.go:110 Path: ./
2021-12-15T16:14:18.523-0700 INFO app/add.go:111 Branch: main
2021-12-15T16:14:18.523-0700 INFO app/add.go:112 Type: kustomize
2021-12-15T16:14:18.523-0700 INFO app/add.go:118
2021-12-15T16:14:18.523-0700 INFO kube/kube.go:70 Checking cluster status
2021-12-15T16:14:18.538-0700 INFO kube/kube.go:81 GitOps installed
2021-12-15T16:14:18.547-0700 INFO automation/generator.go:114 Generating application spec manifest
2021-12-15T16:14:18.548-0700 INFO automation/generator.go:121 Generating GitOps automation manifests
2021-12-15T16:14:20.421-0700 INFO gitopswriter/gitopswriter.go:73 Adding application "mypdi" to cluster "kind-kind" and repository
2021-12-15T16:14:22.901-0700 INFO gitrepo/service.go:45 Pull Request created: https://github.com/palemtnrider/kb3/pull/27

Release notes
yes

Documentation Changes
No

By skipping the caller, the output shows the calling function instead
of the logging wrapper.
@palemtnrider palemtnrider added the type/enhancement New feature or request label Dec 15, 2021
@palemtnrider palemtnrider merged commit a1470ee into main Dec 17, 2021
@palemtnrider palemtnrider deleted the 1238/add-caller-to-log-output branch December 17, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging is printing the line # from the logger instead of the code writing the log
3 participants