-
Notifications
You must be signed in to change notification settings - Fork 174
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
4792: Stop using System.out/err.println and e.printStackTrace #272
Conversation
replaced by java.util.logging logging
👋 Welcome back jpbempel! A progress list of the required criteria for merging this PR into |
Webrevs
|
@@ -78,7 +78,7 @@ private static Method getRegisterMethod(Class<?> producerClass) { | |||
// This should never happen | |||
Agent.getLogger().severe("Failed to find the addEvent method of the producer."); |
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.
Let's just roll them up into one logger call with stacktrace.
@@ -110,10 +110,10 @@ public boolean accept(File dir, String name) { | |||
repository.add(template); | |||
} catch (IOException e) { | |||
// FIXME: Better exception handling | |||
e.printStackTrace(); | |||
ControlPanel.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
"Failed to load local template from file"?
} catch (ParseException e) { | ||
// FIXME: Better exception handling | ||
e.printStackTrace(); | ||
ControlPanel.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
"Failed to parse local template from file " + file...
@@ -237,13 +237,13 @@ private EventConfigurationRepository createRepository(IFlightRecorderService flr | |||
repo.add(new EventConfiguration(EventConfiguration.createModel(templateXML), | |||
VolatileStorageDelegate.getOnServerDelegate())); | |||
} catch (ParseException e) { | |||
e.printStackTrace(); | |||
ControlPanel.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
Add helpful message?
} catch (IOException e) { | ||
e.printStackTrace(); | ||
ControlPanel.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
Add helpful message?
} | ||
} | ||
} catch (FlightRecorderException e) { | ||
e.printStackTrace(); | ||
ControlPanel.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
Add helpful message?
@@ -380,7 +380,7 @@ void repositoryLoaded(EventArrays repo, IRange<IQuantity> fullRange) { | |||
try { | |||
getSite().getPage().showView(CONTENT_OUTLINE_VIEW_ID, null, IWorkbenchPage.VIEW_VISIBLE); | |||
} catch (PartInitException e) { | |||
e.printStackTrace(); | |||
FlightRecorderUI.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
Add helpful message?
@@ -1100,8 +1103,7 @@ private void chooseImageFileDialog() { | |||
imageLabel.getParent().layout(); | |||
setPageComplete(isPageComplete()); | |||
} catch (Exception e) { | |||
// FIXME: Add proper logging | |||
e.printStackTrace(); | |||
LOGGER.log(Level.SEVERE, "", e); |
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.
Add helpful message?
@@ -159,7 +162,7 @@ private void setGroupByField(IAttribute<?> attribute, Boolean ignore) { | |||
try { | |||
buildHistogram(); | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
LOGGER.log(Level.SEVERE, "", e); |
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.
Add helpful message?
@@ -176,7 +179,7 @@ private void combinedGrouping(IAttribute<?> attribute, Boolean ignore) { | |||
try { | |||
buildHistogram(); | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
LOGGER.log(Level.SEVERE, "", e); |
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.
Add helpful message?
@@ -208,7 +208,7 @@ protected void performApply() { | |||
checkedRuleIDs.forEach(id -> ignoredState.createChild(IGNORED_RULES).putString(RULE_ID, id)); | |||
getPreferenceStore().setValue(IGNORED_RULES, ignoredState.toString()); | |||
} catch (IOException e) { | |||
e.printStackTrace(); | |||
FlightRecorderUI.getDefault().getLogger().log(Level.SEVERE, "", e); |
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.
Add helpful message?
@@ -116,7 +119,7 @@ public boolean hasNext() { | |||
file.close(); | |||
} catch (IOException e) { | |||
// Shouldn't happen. | |||
e.printStackTrace(); | |||
LOGGER.log(Level.SEVERE, "", e); |
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.
Add helpful message?
@jpbempel This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 15 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit c6e0606.
Your commit was automatically rebased without conflicts. |
replaced by java.util.logging logging
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jmc pull/272/head:pull/272
$ git checkout pull/272
Update a local copy of the PR:
$ git checkout pull/272
$ git pull https://git.openjdk.java.net/jmc pull/272/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 272
View PR using the GUI difftool:
$ git pr show -t 272
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jmc/pull/272.diff