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

[Minor] Improve log messages #6531

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

justinmclean
Copy link
Member

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

@justinmclean justinmclean self-assigned this Feb 26, 2025
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.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Check this again?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

@justinmclean justinmclean Feb 27, 2025

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");
Copy link
Contributor

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"?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.");
Copy link
Contributor

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.

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.

3 participants