/** * Start creating a {@link FormattedLog} with the specified zoneId from timezone for datestamps in the log * * @param timezone to use * @return a builder for a {@link FormattedLog} * @deprecated use {@link #withZoneId(ZoneId)} */ @Deprecated public static Builder withTimeZone( TimeZone timezone ) { return new Builder().withZoneId( timezone.toZoneId() ); }
/** * Start creating a {@link FormattedLog} with the specified zoneId from timezone for datestamps in the log * * @param timezone to use * @return a builder for a {@link FormattedLog} * @deprecated use {@link #withZoneId(ZoneId)} */ @Deprecated public static Builder withTimeZone( TimeZone timezone ) { return new Builder().withZoneId( timezone.toZoneId() ); }
/** * Creates a {@link FormattedLog} 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 FormattedLog} instance that writes to the specified PrintWriter */ public static FormattedLog toPrintWriter( Supplier<PrintWriter> writerSupplier ) { return new Builder().toPrintWriter( writerSupplier ); }
/** * Start creating a {@link FormattedLog} with the specified log {@link Level} as a default. * Use {@link Builder#toOutputStream} to complete. * * @param level the log level to use as a default * @return a builder for a {@link FormattedLog} */ public static Builder withLogLevel( Level level ) { return new Builder().withLogLevel( level ); }
/** * Start creating a {@link FormattedLog} using the specified object to synchronize on. * Use {@link Builder#toOutputStream} to complete. * * @param lock the object to synchronize on * @return a builder for a {@link FormattedLog} */ public static Builder usingLock( Object lock ) { return new Builder().usingLock( lock ); }
/** * Creates a {@link FormattedLog} instance that writes messages to a {@link PrintWriter}. * * @param writer A {@link PrintWriter} to write to * @return A {@link FormattedLog} instance that writes to the specified PrintWriter */ public static FormattedLog toPrintWriter( PrintWriter writer ) { return new Builder().toPrintWriter( writer ); }
/** * Creates a {@link FormattedLog} 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 FormattedLog} instance */ public static FormattedLog toOutputStream( Supplier<OutputStream> outSupplier ) { return new Builder().toOutputStream( outSupplier ); }
/** * Creates a {@link FormattedLog} instance that writes messages to a {@link Writer}. * * @param writer A {@link Writer} to write to * @return A {@link FormattedLog} instance that writes to the specified Writer */ public static FormattedLog toWriter( Writer writer ) { return new Builder().toWriter( writer ); }
/** * Creates a {@link FormattedLog} instance that writes messages to an {@link OutputStream}. * * @param out An {@link OutputStream} to write to * @return A {@link FormattedLog} instance that writes to the specified OutputStream */ public static FormattedLog toOutputStream( OutputStream out ) { return new Builder().toOutputStream( out ); }
/** * Creates a {@link FormattedLog} instance that writes messages to a {@link Writer}. * * @param writer A {@link Writer} to write to * @return A {@link FormattedLog} instance that writes to the specified Writer */ public static FormattedLog toWriter( Writer writer ) { return new Builder().toWriter( writer ); }
/** * Creates a {@link FormattedLog} 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 FormattedLog} instance */ public static FormattedLog toOutputStream( Supplier<OutputStream> outSupplier ) { return new Builder().toOutputStream( outSupplier ); }
/** * Start creating a {@link FormattedLog} without auto flushing. * Use {@link Builder#toOutputStream} to complete. * * @return a builder for a {@link FormattedLog} */ public static Builder withoutAutoFlush() { return new Builder().withoutAutoFlush(); }
/** * Include the specified category in each output log line * * @param category the category to include ing each output line * @return a builder for a {@link FormattedLog} */ public static Builder withCategory( String category ) { return new Builder().withCategory( category ); }
/** * Creates a {@link FormattedLog} instance that writes messages to an {@link OutputStream}. * * @param out An {@link OutputStream} to write to * @return A {@link FormattedLog} instance that writes to the specified OutputStream */ public static FormattedLog toOutputStream( OutputStream out ) { return new Builder().toOutputStream( out ); }
/** * Start creating a {@link FormattedLog} with the specified log {@link Level} as a default. * Use {@link Builder#toOutputStream} to complete. * * @param level the log level to use as a default * @return a builder for a {@link FormattedLog} */ public static Builder withLogLevel( Level level ) { return new Builder().withLogLevel( level ); }
/** * Start creating a {@link FormattedLog} using the specified object to synchronize on. * Use {@link Builder#toOutputStream} to complete. * * @param lock the object to synchronize on * @return a builder for a {@link FormattedLog} */ public static Builder usingLock( Object lock ) { return new Builder().usingLock( lock ); }
/** * Start creating a {@link FormattedLog} with UTC timezone for datestamps in the log * * @return a builder for a {@link FormattedLog} */ public static Builder withUTCTimeZone() { return new Builder().withUTCZoneId(); }
/** * Start creating a {@link FormattedLog} with the specified zoneId for datestamps in the log * * @param zoneId to use * @return a builder for a {@link FormattedLog} */ public static Builder withZoneId( ZoneId zoneId ) { return new Builder().withZoneId( zoneId ); }
/** * Creates a {@link FormattedLog} 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 FormattedLog} instance that writes to the specified PrintWriter */ public static FormattedLog toPrintWriter( Supplier<PrintWriter> writerSupplier ) { return new Builder().toPrintWriter( writerSupplier ); }
/** * Creates a {@link FormattedLog} instance that writes messages to a {@link PrintWriter}. * * @param writer A {@link PrintWriter} to write to * @return A {@link FormattedLog} instance that writes to the specified PrintWriter */ public static FormattedLog toPrintWriter( PrintWriter writer ) { return new Builder().toPrintWriter( writer ); }