如下,是不是脱裤子放屁?哈哈,我是小白大佬轻喷
public class FuckLog4j {
public final static void out(Object s) {
CompletableFuture.runAsync(() -> {
System.out.println(s);
});
}
public final static void err(Object o) {
CompletableFuture.runAsync(() -> {
System.err.println(o);
});
}
}
1
kenvix 2022 年 2 月 6 日 你这样打出来的可能会乱序的
|
2
nightwitch 2022 年 2 月 6 日
正经项目不用 println ,用日志库。
|
3
bthulu 2022 年 2 月 7 日
CompletableFuture 默认线程池就是你的 CPU 个数, 而 IO 操作一般倾向于新开线程处理, 而不是用线程池
|
4
Hug125 2022 年 2 月 7 日
@nightwitch #2 正解
|
5
ikas 2022 年 2 月 8 日
很厉害 FuckLog4j
|