### Question:
FormattedLog extends AbstractLog { public Level setLevel( Level level ) { return levelRef.getAndSet( level ); } protected  FormattedLog(
            Supplier<PrintWriter> writerSupplier,
            ZoneId zoneId,
            Object maybeLock,
            String category,
            Level level,
            boolean autoFlush ); protected  FormattedLog(
            Supplier<PrintWriter> writerSupplier,
            ZoneId zoneId,
            Object maybeLock,
            String category,
            Level level,
            boolean autoFlush,
            DateTimeFormatter dateTimeFormatter,
            Supplier<ZonedDateTime> dateTimeSupplier ); static Builder withUTCTimeZone(); @Deprecated static Builder withTimeZone( TimeZone timezone ); static Builder withZoneId( ZoneId zoneId ); static Builder usingLock( Object lock ); static Builder withCategory( String category ); static Builder withLogLevel( Level level ); static Builder withoutAutoFlush(); static FormattedLog toOutputStream( OutputStream out ); static FormattedLog toOutputStream( Supplier<OutputStream> outSupplier ); static FormattedLog toWriter( Writer writer ); static FormattedLog toPrintWriter( PrintWriter writer ); static FormattedLog toPrintWriter( Supplier<PrintWriter> writerSupplier ); Level getLevel(); Level setLevel( Level level ); @Override boolean isDebugEnabled(); @Nonnull @Override Logger debugLogger(); boolean isInfoEnabled(); @Nonnull @Override Logger infoLogger(); boolean isWarnEnabled(); @Nonnull @Override Logger warnLogger(); boolean isErrorEnabled(); @Nonnull @Override Logger errorLogger(); @Override void bulk( @Nonnull Consumer<Log> consumer );  }### Answer:
@Test void shouldAllowLevelToBeChanged() { StringWriter writer = new StringWriter(); FormattedLog log = newFormattedLog( writer, Level.INFO); log.info( "No, it's when there's nothing wrong with you, but you hurt anyway. You get it?" ); log.setLevel( Level.WARN ); log.info( "I know now why you cry. But it's something I can never do." ); log.setLevel( Level.DEBUG ); log.info( "There's 215 bones in the human body. That's one." ); assertThat( writer.toString(), equalTo( format( "%s%n%s%n", "1984-10-26 04:23:24.343+0000 INFO [test] No, it's when there's nothing wrong with you, but " + "you hurt anyway. You get it?", "1984-10-26 04:23:24.343+0000 INFO [test] There's 215 bones in the human body. That's one." ) ) ); }