Skip to content

Commit 61325a4

Browse files
committed
log exceptions to console
1 parent eb223ab commit 61325a4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

visualvm/graalvm/src/org/graalvm/visualvm/graalvm/libgraal/MemoryModel.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
import java.util.ArrayList;
3434
import java.util.Collections;
3535
import java.util.List;
36+
import java.util.logging.Level;
37+
import java.util.logging.Logger;
3638
import javax.management.Attribute;
37-
import javax.management.AttributeList;
3839
import javax.management.MBeanServerConnection;
3940
import javax.management.ObjectName;
4041
import javax.management.openmbean.CompositeData;
@@ -55,13 +56,13 @@
5556
import org.graalvm.visualvm.core.snapshot.Snapshot;
5657
import org.graalvm.visualvm.tools.jmx.JmxModel;
5758
import org.graalvm.visualvm.tools.jmx.JmxModelFactory;
58-
import org.openide.util.Exceptions;
5959

6060
/**
6161
*
6262
* @author Tomas Hurka
6363
*/
6464
final class MemoryModel {
65+
private static final Logger LOGGER = Logger.getLogger(MemoryModel.class.getName());
6566

6667
private static final String PROP_PREFIX = "LibgraalModel_"; // NOI18N
6768
private static final String USAGE_ATTRIBUTE = "Usage"; // NOI18N
@@ -223,14 +224,14 @@ private static void saveChartSupport(SimpleXYChartSupport chartSupport, File fil
223224
os = new FileOutputStream(file);
224225
chartSupport.saveValues(os);
225226
} catch (Exception e) {
226-
// TODO: log it
227+
LOGGER.log(Level.INFO, "saveChartSupport", e); // NOI18N
227228
} finally {
228229
try {
229230
if (os != null) {
230231
os.close();
231232
}
232233
} catch (Exception e) {
233-
// TODO: log it
234+
LOGGER.log(Level.INFO, "saveChartSupport", e); // NOI18N
234235
}
235236
}
236237
}
@@ -242,14 +243,14 @@ private static void loadChartSupport(SimpleXYChartSupport chartSupport, File fil
242243
is = new FileInputStream(file);
243244
chartSupport.loadValues(is);
244245
} catch (Exception e) {
245-
// TODO: log it
246+
LOGGER.log(Level.INFO, "loadChartSupport", e); // NOI18N
246247
} finally {
247248
try {
248249
if (is != null) {
249250
is.close();
250251
}
251252
} catch (Exception e) {
252-
// TODO: log it
253+
LOGGER.log(Level.INFO, "loadChartSupport", e); // NOI18N
253254
}
254255
}
255256
}
@@ -320,7 +321,7 @@ private Object[] getAttributes(String... names) {
320321
}
321322
return values;
322323
} catch (Exception ex) {
323-
Exceptions.printStackTrace(ex);
324+
LOGGER.log(Level.INFO, "getAttributes", ex); // NOI18N
324325
}
325326
return null;
326327
}

0 commit comments

Comments
 (0)