-
Notifications
You must be signed in to change notification settings - Fork 12
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
Usage debug #285
Usage debug #285
Conversation
Previous design allowed usage report to be sent for Legacy plugins only when debugMode was set to true.
This PR should be approved and merged after #283 due to the scijava version bump commit that is hanging around here. |
reader.lines().forEach(IJ::log); | ||
} | ||
} catch (final IOException e) { | ||
IJ.error(e.getMessage()); | ||
} |
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 am probably being silly but I don't understand how the changes make a difference.
The only thing I see changing when IJ.debugMode
is false
is that the reader
variable gets constructed, and then goes out of scope at the end of the send()
function?
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.
Right - no idea either. I knocked out some lines to see what is essential and it's this:
final BufferedReader reader = new BufferedReader(new InputStreamReader(uc.getInputStream()))
Which I interpret to mean that the request isn't actually sent until the BufferedReader
tries to read from the URLConnection
. Or something like that.
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.
Might be worth sticking a comment in there saying that the construction of the BufferedReader
seems to be essential as that isn't clear from reading the code on its own. Otherwise happy with this.
* Update scijava to 30.0.0 * Allow usage report to be sent for Legacy plugins Previous design allowed usage report to be sent for Legacy plugins only when debugMode was set to true. * Comment to explain structure of send() method
Usage data were not being collected for Legacy plugins when debug mode was off.