测试
This commit is contained in:
parent
949c1ee51a
commit
8dbf5293ba
15
.idea/git_toolbox_prj.xml
Normal file
15
.idea/git_toolbox_prj.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
53
starter/src/main/resources/logback.xml
Normal file
53
starter/src/main/resources/logback.xml
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
|
||||
<contextName>logback</contextName>
|
||||
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
|
||||
<!--<property name="log.path" value="./log/business_Log" />-->
|
||||
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">-->
|
||||
<!-- <level>INFO</level>-->
|
||||
<!-- </filter>-->
|
||||
<!-- <withJansi>true</withJansi>-->
|
||||
<encoder>
|
||||
<!--<pattern>%d %p (%file:%line\)- %m%n</pattern>-->
|
||||
<!--格式化输出:%d:表示日期 %thread:表示线程名 %-5level:级别从左显示5个字符宽度 %msg:日志消息 %n:是换行符-->
|
||||
<pattern>%red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %yellow(at %class.%method) (%file:%line\) - %cyan(%msg%n)</pattern>
|
||||
<!--<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %magenta(%-5level) %green([%-50.50class]) >>> %cyan(%msg) %n</pattern>-->
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--<!–输出到文件–>-->
|
||||
<!--<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
|
||||
<!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">-->
|
||||
<!-- <level>INFO</level>-->
|
||||
<!-- </filter>-->
|
||||
<!-- <file>${log.path}/logback.log</file>-->
|
||||
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
|
||||
<!-- <fileNamePattern>${log.path}/logback-%d{yyyy-MM-dd-HH-mm}.log</fileNamePattern>-->
|
||||
<!-- <maxHistory>365</maxHistory>-->
|
||||
<!-- <!– <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">–>-->
|
||||
<!-- <!– <maxFileSize>100kB</maxFileSize>–>-->
|
||||
<!-- <!– </timeBasedFileNamingAndTriggeringPolicy>–>-->
|
||||
<!-- </rollingPolicy>-->
|
||||
<!-- <encoder>-->
|
||||
<!-- <!–格式化输出:%d:表示日期 %thread:表示线程名 %-5level:级别从左显示5个字符宽度 %msg:日志消息 %n:是换行符–>-->
|
||||
<!-- <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>-->
|
||||
<!-- <charset>UTF-8</charset>-->
|
||||
<!-- </encoder>-->
|
||||
<!--</appender>-->
|
||||
|
||||
<!-- 如果appender里没有限定日志级别,那么root可以统一设置,如果没有配置那么控制台和文件不会输出任何日志,这里root的level不做限制-->
|
||||
<root level="INFO">
|
||||
<!-- 允许控制台输出-->
|
||||
<appender-ref ref="console" />
|
||||
<!--<!– 允许文件输出–>-->
|
||||
<!--<appender-ref ref="file" />-->
|
||||
</root>
|
||||
|
||||
<logger name="cn.skcks.study.rxjava" level="DEBUG" />
|
||||
</configuration>
|
@ -21,12 +21,15 @@ public class RxJavaStudyStarterTest {
|
||||
Observable<Integer> integerObservable = Observable.create((ObservableOnSubscribe<Integer>) emitter -> {
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
emitter.onNext(i);
|
||||
Thread.sleep((long) (Math.random() * 100));
|
||||
}
|
||||
emitter.onComplete();
|
||||
}).observeOn(Schedulers.io());
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(Schedulers.newThread());
|
||||
|
||||
integerObservable.subscribe(item -> System.out.println("Subscribe Next: " + item));
|
||||
integerObservable.subscribe(item -> System.out.println("println: Subscribe Next: " + item));
|
||||
integerObservable.subscribe(item -> log.info("[logInfo] Subscribe Next: {}", item));
|
||||
integerObservable.blockingSubscribe();
|
||||
|
||||
Observable<Integer> take = Observable.fromArray(1, 2, 3, 4, 5)
|
||||
.observeOn(Schedulers.computation()).skip(2).take(1);
|
||||
|
Loading…
Reference in New Issue
Block a user