/** * Write to the given {@link java.io.OutputStream}. * @param stream a {@link java.io.OutputStream} instance * @return {@code this} */ public T outputTo(OutputStream stream) { try { this.output = new PrintStream(stream, false, Charsets.UTF_8.toString()); } catch(UnsupportedEncodingException exception) { LOGGER.error("Unsupported encoding in OutputStreamReporter. This is an error with the code itself.", exception); throw new RuntimeException(exception); } return self(); }
/** * Write to the given {@link java.io.OutputStream}. * @param stream a {@link java.io.OutputStream} instance * @return {@code this} */ public T outputTo(OutputStream stream) { try { this.output = new PrintStream(stream, false, Charsets.UTF_8.toString()); } catch(UnsupportedEncodingException exception) { LOGGER.error("Unsupported encoding in OutputStreamReporter. This is an error with the code itself.", exception); throw new RuntimeException(exception); } return self(); }
@Override public ScheduledReporter newScheduledReporter(MetricRegistry registry, Properties properties) throws IOException { try { return OutputStreamEventReporter.forContext(MetricContext.class.cast(registry)).build(); } catch (ClassCastException cce) { throw new IOException(cce); } } }
/** * Write to the given {@link java.io.PrintStream}. * * @param output a {@link java.io.PrintStream} instance. * @return {@code this} */ public T outputTo(PrintStream output) { this.output = output; return self(); }
@Override public ScheduledReporter newScheduledReporter(MetricRegistry registry, Properties properties) throws IOException { try { return OutputStreamEventReporter.forContext(MetricContext.class.cast(registry)).build(); } catch (ClassCastException cce) { throw new IOException(cce); } } }
/** * Write to the given {@link java.io.PrintStream}. * * @param output a {@link java.io.PrintStream} instance. * @return {@code this} */ public T outputTo(PrintStream output) { this.output = output; return self(); }