ktee:Tee for Kotlin

时间:2021-05-03 09:26:47
【文件属性】:
文件名称:ktee:Tee for Kotlin
文件大小:64KB
文件格式:ZIP
更新时间:2021-05-03 09:26:47
kotlin debugging utility logging micro-library KTee KTee是Kotlin代码管道的Tee。 如果您喜欢unix命令行tee ,那么您就会知道我们的意思。 为什么? 通常,我们需要打破一个完美的计算管道,以便能够记录中间值。 例如,让我们看一下这段代码: ( 1 .. 10 ) .filter { it % 2 == 0 } .map { it * 2 } .reduce( Int ::plus) 如果要打印filter或map的结果,则需要将结果捕获到中间val或使用日志记录语句添加.let { } 。 KTee大大简化了打印中间值。 如何? 只需.tee() 。 严重地! 试试这个: ( 1 .. 10 ) .filter { it % 2 == 0 }.tee() .map { it * 2 }.tee() .reduce( Int ::plus).tee()
【文件预览】:
ktee-master
----.gitignore(24B)
----settings.gradle(26B)
----build.gradle(3KB)
----src()
--------main()
--------test()
----gradlew(6KB)
----LICENSE(1KB)
----.github()
--------workflows()
----README.md(3KB)
----gradlew.bat(3KB)
----gradle()
--------wrapper()
----.gitattributes(31B)

网友评论