/** * Creates a {@link FormattedLogProvider} instance that writes messages to a {@link Writer}. * * @param writer A {@link Writer} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified Writer */ public FormattedLogProvider toWriter( Writer writer ) { return toPrintWriter( new PrintWriter( writer ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to an {@link OutputStream}. * * @param out An {@link OutputStream} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified OutputStream */ public FormattedLogProvider toOutputStream( OutputStream out ) { return toPrintWriter( Suppliers.singleton( OUTPUT_STREAM_CONVERTER.apply( out ) ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to a {@link Writer}. * * @param writer A {@link Writer} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified Writer */ public FormattedLogProvider toWriter( Writer writer ) { return toPrintWriter( new PrintWriter( writer ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to {@link PrintWriter}s obtained from the specified * {@link Supplier}. The PrintWriter is obtained from the Supplier before every log message is written. * * @param writerSupplier A supplier for a {@link PrintWriter} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified PrintWriter */ public static FormattedLogProvider toPrintWriter( Supplier<PrintWriter> writerSupplier ) { return new Builder().toPrintWriter( writerSupplier ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to a {@link PrintWriter}. * * @param writer A {@link PrintWriter} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified PrintWriter */ public static FormattedLogProvider toPrintWriter( PrintWriter writer ) { return new Builder().toPrintWriter( writer ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to an {@link OutputStream}. * * @param out An {@link OutputStream} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified OutputStream */ public FormattedLogProvider toOutputStream( OutputStream out ) { return toPrintWriter( Suppliers.singleton( OUTPUT_STREAM_CONVERTER.apply( out ) ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to a {@link PrintWriter}. * * @param writer A {@link PrintWriter} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified PrintWriter */ public FormattedLogProvider toPrintWriter( PrintWriter writer ) { return toPrintWriter( Suppliers.singleton( writer ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to {@link OutputStream}s obtained from the specified * {@link Supplier}. The OutputStream is obtained from the Supplier before every log message is written. * * @param outSupplier A supplier for an output stream to write to * @return A {@link FormattedLogProvider} instance */ public FormattedLogProvider toOutputStream( Supplier<OutputStream> outSupplier ) { return toPrintWriter( Suppliers.adapted( outSupplier, OUTPUT_STREAM_CONVERTER ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to {@link OutputStream}s obtained from the specified * {@link Supplier}. The OutputStream is obtained from the Supplier before every log message is written. * * @param outSupplier A supplier for an output stream to write to * @return A {@link FormattedLogProvider} instance */ public FormattedLogProvider toOutputStream( Supplier<OutputStream> outSupplier ) { return toPrintWriter( Suppliers.adapted( outSupplier, OUTPUT_STREAM_CONVERTER ) ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to {@link PrintWriter}s obtained from the specified * {@link Supplier}. The PrintWriter is obtained from the Supplier before every log message is written. * * @param writerSupplier A supplier for a {@link PrintWriter} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified PrintWriter */ public static FormattedLogProvider toPrintWriter( Supplier<PrintWriter> writerSupplier ) { return new Builder().toPrintWriter( writerSupplier ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to a {@link PrintWriter}. * * @param writer A {@link PrintWriter} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified PrintWriter */ public static FormattedLogProvider toPrintWriter( PrintWriter writer ) { return new Builder().toPrintWriter( writer ); }
/** * Creates a {@link FormattedLogProvider} instance that writes messages to a {@link PrintWriter}. * * @param writer A {@link PrintWriter} to write to * @return A {@link FormattedLogProvider} instance that writes to the specified PrintWriter */ public FormattedLogProvider toPrintWriter( PrintWriter writer ) { return toPrintWriter( Suppliers.singleton( writer ) ); }