-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Minor] Improve log messages #6531
base: main
Are you sure you want to change the base?
Conversation
Preconditions.checkArgument( | ||
authzMetadataObject.names().size() == 1, | ||
"The size of the metadata object's name must be 1."); | ||
"The size of the metadata object's size must be 1."); |
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.
Check this again?
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.
"name must be 1" makes no sense unless you mean the name must be the letter 1, which is not intended here.
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 mean "The size of the metadata object's size" doesn't make sense ... WDYT?
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.
it makes sense to me, and I don't think most people would find that confusing - as a Precondition, it's more aimed at developers.
@@ -361,9 +361,9 @@ private void removeTableMetadataObject(AuthorizationMetadataObject authzMetadata | |||
authzMetadataObject instanceof PathBasedMetadataObject, | |||
"The metadata object must be a PathBasedMetadataObject"); | |||
Preconditions.checkArgument( | |||
authzMetadataObject.names().size() == 3, "The metadata object names must be 3"); | |||
authzMetadataObject.names().size() == 3, "The metadata object size must be 3"); |
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.
Em ... What is "metadata object size"?
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.
"Names must be 3" makes no sense, "size must be 3" does. This message is aimed at programmers, and they would understand that it needs to have 3 elements in it.
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.
OK.
Then how do I interpret "authzMetadataObject.names().size()" in plain English?
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 size of the name or the metadata's object size or the metadata's name size, or if you really want to be verbose, the number of elements in the metadata's object's name.
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.
Metadata object has a name identifier. The name identifier consists of names. This should be size of names instead of size of object.
@@ -281,7 +281,7 @@ private void removeSchemaMetadataObject(AuthorizationMetadataObject authzMetadat | |||
authzMetadataObject.type() == SCHEMA, "The metadata object type must be a schema"); | |||
Preconditions.checkArgument( | |||
authzMetadataObject.names().size() == 1, | |||
"The size of the metadata object's size must be 1."); | |||
"The metadata object's size must be 1."); |
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.
This reads much better. Thanks.
What changes were proposed in this pull request?
Improve a couple of log messages.
Why are the changes needed?
For clarity.
Fix: #(issue)
Does this PR introduce any user-facing change?
No.
How was this patch tested?
N/A