/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
/** * Construct a handler. * * @param handler The handler to copy properties from. * @param formatter The formatter to use. * @throws UnsupportedEncodingException if the encoding is not valid. */ public Stdout(final Handler handler, final Formatter formatter) throws UnsupportedEncodingException { super(System.out, formatter); setErrorManager(handler.getErrorManager()); setFilter(handler.getFilter()); setLevel(handler.getLevel()); setEncoding(handler.getEncoding()); }
/** * Return the character encoding for this Handler. */ public String getEncoding() { return handler.getEncoding(); }
/** * {@inheritDoc} */ public String getEncoding() { return handler.getEncoding(); }
/** * {@inheritDoc} */ public String getEncoding() { return handler.getEncoding(); }
/** * {@inheritDoc} */ public String getEncoding() { return handler.getEncoding(); }
public String getEncoding(T handler) { return handler.getEncoding(); }
@Override public String getEncoding() { return this.delegate != null ? this.delegate.getEncoding() : null; }
@Override public String getHead(Handler h) { String encoding = null; if (h != null) encoding = h.getEncoding(); if (encoding == null) encoding = System.getProperty("file.encoding"); StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
@Nullable @Override public String getEncoding() { return this.delegate != null ? this.delegate.getEncoding() : null; }
/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
/** * Returns the header string for a set of log records formatted as XML * strings, using the output handler's encoding if it is defined, otherwise * using the default platform encoding. * * @param h * the output handler, may be {@code null}. * @return the header string for log records formatted as XML strings. */ @Override public String getHead(Handler h) { String encoding = null; if (h != null) { encoding = h.getEncoding(); } if (encoding == null) { encoding = System.getProperty("file.encoding"); } StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>"); sb.append(System.lineSeparator()); sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">"); sb.append(System.lineSeparator()); sb.append("<log>"); return sb.toString(); }
try { h.setLevel(getLevel()); h.setEncoding(getEncoding()); h.setFilter(null); h.setFormatter(getFormatter());
try { h.setLevel(getLevel()); h.setEncoding(getEncoding()); h.setFilter(getFilter()); h.setFormatter(getFormatter());
/** * Constructs a handler. * * @param handler The handler to copy properties from. * @param formatter The formatter to use. */ public Stdout(final Handler handler, final Formatter formatter) throws UnsupportedEncodingException { super(System.out, formatter); setErrorManager(handler.getErrorManager()); setFilter (handler.getFilter ()); setLevel (handler.getLevel ()); setEncoding (handler.getEncoding ()); }
h.setEncoding(getEncoding()); h.setErrorManager(getErrorManager()); h.setFilter((Filter) null);