-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
No description provided.