-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Metricbeat] Rename Logger method to Log #11126
Conversation
Based on the comment elastic#11106 (comment) the Logger method is renamed to Log. It turned out this was already almost a convention which we used across the metricsets. This meant the Log variable and Log() method conflicted and required an update in the metricsets that had a Log variable. No functionality was changed in this PR.
Put to |
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.
LGTM 😄
@@ -275,7 +275,7 @@ func (b *BaseMetricSet) Metrics() *monitoring.Registry { | |||
} | |||
|
|||
// Logger returns the 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.
The godoc here will need updated too.
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.
Seems like you are better then hound :-)
+1 on shorter names |
+1, Seems good. |
+1 but this does raise the question of whether it would be good to document these sorts of conventions in the developer documentation. |
@cachedout Yes, @fearful-symmetry has some ideas plans around this. |
My 2 cents: This breaks common naming conventions and I don't think that by documenting it, it will help to understand code better and faster, let me explain:
As you can see, actions/verbs are usually function or type methods while nouns are usually types. This methodology is actually quite old (I think from the times of UML) but it's still valid today and makes a lot of sense. +1 on shorter names if they don't affect code comprehension for new arrivals or community contributors. All in all that's why we all have autocomplete in our IDE 😉 |
Closing this PR as it will not make a big difference from my point of view. If someone wants to take over, please go for it :-) |
Based on the comment #11106 (comment) the Logger method is renamed to Log. It turned out this was already almost a convention which we used across the metricsets. This meant the Log variable and Log() method conflicted and required an update in the metricsets that had a Log variable.
No functionality was changed in this PR.