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

[GP-4245] Debug logging for jira client #1290

Merged
merged 7 commits into from
Apr 23, 2024
Merged

[GP-4245] Debug logging for jira client #1290

merged 7 commits into from
Apr 23, 2024

Conversation

avarsava
Copy link
Contributor

JIRA Ticket: GP-4245

  • Updates Changelog
  • Updates developer documentation

@avarsava avarsava requested review from djcooke and jrajawat April 17, 2024 19:56
Copy link
Contributor

@djcooke djcooke left a comment

Choose a reason for hiding this comment

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

Probably want to combine multi-part messages into a single message to avoid them getting separated since multiple threads will be writing to the same log

@avarsava
Copy link
Contributor Author

Probably want to combine multi-part messages into a single message to avoid them getting separated since multiple threads will be writing to the same log

Makes sense! fixed

@avarsava avarsava requested review from djcooke and jrajawat April 18, 2024 18:55
@avarsava
Copy link
Contributor Author

Re-requesting review because I realized nothing had a proper toString so the debug logs would be less than useful and then everything spiraled out of control from there

Comment on lines 195 to 197
protected abstract String getKType();

protected abstract String getVType();
Copy link
Contributor

Choose a reason for hiding this comment

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

getKeyType and getValueType would be more clear, but you're also basically defining these at the class level. Would it be more useful to just log the class name in toString rather than the type parameters? That would also be more concise and impossible to mess up when implementing a new subclass

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 designed it this way to minimize repeat code, if I moved toString to the class level then there would be ~20 lines of repeat code in each child class of KeyValueCache

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that "KType" and "VType" are being defined at the class level right now - the return value is a static String for all implementations. This means the class name is just as useful, if not more so since 2 classes could have the same types. In KeyValueCache#toString you could just log getClass() (or one of its String properties) instead of needing getKType and getVType methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't realize this would get the actual class name instead of the abstract class's name, thanks, fixed

StringBuilder writeOut = new StringBuilder();
writeOut.append("Action type filter of types: ");
for (String type : types) {
writeOut.append(type).append(", ");
Copy link
Contributor

Choose a reason for hiding this comment

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

Leaves an extra comma at the end, which could be confusing. Could use String.join instead, or delete from the StringBuilder after. Same pattern in a few other places too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

return writeOut.toString();
}

protected abstract String getOperation();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would logging the class name here be just as useful too since these are all defined basically at the class level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -69,4 +69,19 @@ public final void setEnd(Long end) {
public final void setStart(Long start) {
this.start = start;
}

protected abstract String getName();
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, would the logging the class name be just as good?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@djcooke
Copy link
Contributor

djcooke commented Apr 23, 2024

Looks good once compile errors are fixed (missed removing a few of the getKType/getVType/getOperation implementations)

@avarsava avarsava merged commit 28087cc into master Apr 23, 2024
9 checks passed
@avarsava avarsava deleted the GP-4245_logging branch April 23, 2024 14:20
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