概述¶
如果想要在 Kotlin/Java 应用中启用日志打印,需要配置 LogPrinter 插件,并调用 desktop() 来获取 DesktopLogger 。
val logFactory: LogFactory = getLogFactory {
...
install(LogPrinter) {
logger = Logger.desktop()
}
}
添加依赖¶
implementation 'io.github.sakurajimamaii:log-desktop:$version'
implementation("io.github.sakurajimamaii:log-desktop:$version")