List of usage examples for java.util.logging Handler getErrorManager
public ErrorManager getErrorManager()
From source file:MailHandlerDemo.java
/** * Gets a formatting string describing the given handler. * * @param prefix the output prefix./*from www .ja va2 s. c o m*/ * @param err the error stream. * @param h the handler. * @return the formatted string. */ private static String toString(String prefix, PrintStream err, Handler h) { StringBuilder buf = new StringBuilder(); buf.append(h.getClass().getName()); try { if (h instanceof MailHandler) { MailHandler mh = (MailHandler) h; buf.append(", ").append(mh.getSubject()); } } catch (SecurityException error) { err.print(prefix + ": "); error.printStackTrace(err); } try { buf.append(", ").append(h.getFormatter()); } catch (SecurityException error) { err.print(prefix + ": "); error.printStackTrace(err); } try { if (h instanceof MailHandler) { MailHandler mh = (MailHandler) h; buf.append(", ").append(Arrays.toString(mh.getAttachmentFormatters())); } } catch (SecurityException error) { err.print(prefix + ": "); error.printStackTrace(err); } try { buf.append(", ").append(h.getLevel()); } catch (SecurityException error) { err.print(prefix + ": "); error.printStackTrace(err); } try { buf.append(", ").append(h.getFilter()); } catch (SecurityException error) { err.print(prefix + ": "); error.printStackTrace(err); } try { buf.append(", ").append(h.getErrorManager()); } catch (SecurityException error) { err.print(prefix + ": "); error.printStackTrace(err); } buf.append(", ").append(toString(h.getClass().getClassLoader())); return buf.toString(); }