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

Implementing Structured Logging #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

davis-gomes
Copy link
Contributor

No description provided.

Copy link
Contributor

@markxnelson markxnelson left a comment

Choose a reason for hiding this comment

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

don't check in the .DS_Store files -- add an entry to the .gitgnore to prevent this common accident

@@ -99,11 +100,14 @@ func createIngressElement(sauron *vmcontrollerv1.VerrazzanoMonitoringInstance, h

// New will return a new Service for Sauron that needs to executed for on Complete
func New(sauron *vmcontrollerv1.VerrazzanoMonitoringInstance) ([]*extensions_v1beta1.Ingress, error) {
//create log for new creating service
logger := zerolog.New(os.Stderr).With().Timestamp().Str("kind", "VerrazzanoMonitoringInstance").Str("name", sauron.Name).Logger()
Copy link
Contributor

Choose a reason for hiding this comment

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

we seem to be doing this in each file - that is probably something we should centralize -make a func to do this, and pass in the params, and use that func everywhere, so we know we always get the same behavior, if we need to change it, we only have to change in one place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe making a separate function would not create much centralization. The variable part of this code (eg. the Str("kind", "VerrazzanoMonitoringInstance") functions) are variable dependent upon the function they reside in. This means we would only cut down on the verbosity of the declarations and increase the complexity. In the end, this line would still be necessary to create a logger instance within each function. Please let me know if I am missing something, or if this explanation doesn't adequately address the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants