Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

release: configure go logger to log using our go-kit logger #306

Merged
merged 1 commit into from
Feb 17, 2020

Conversation

stefansedich
Copy link
Contributor

@stefansedich stefansedich commented Feb 16, 2020

Ensure all logging is wrapped using our logger so that the things like the users preferred logging format is respected for all logs even those logging directly to log.Printf.

This somewhat tackles #301 but due to the reasons mentioned over there adding log context to these log lines is not possibly without introducing changes over in Helm itself.

Tested this using an unknown hook as seen to be logging using log.Printf here https://github.com/helm/helm/blob/840bbc951ea026297a5afeffdf913bd6bc79f20f/pkg/releaseutil/manifest_sorter.go#L192

ts=2020-02-16T18:52:09.869319509Z caller=logwriter.go:28 info="2020/02/16 18:52:09 info: skipping unknown hook: \"foo\""

@@ -159,6 +160,10 @@ func main() {
logger = log.With(logger, "caller", log.DefaultCaller)
}

// configure go logger to output using go-kit log
logWriter := helm.NewLogWriter(logger)
Copy link
Member

Choose a reason for hiding this comment

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

Given this is now utilized as a global thing, I think it should be moved to an utils package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hiddeco done

@hiddeco hiddeco merged commit 72a31e0 into fluxcd:master Feb 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants