Switch Kotlin-Logging to KmLogging

This commit is contained in:
Syer10
2022-03-25 22:30:34 -04:00
parent 0852f08a84
commit 7fd9544f3d
34 changed files with 203 additions and 189 deletions

View File

@@ -1,16 +0,0 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package ca.gosyer.jui.core.logging
import mu.KLogger
import mu.KotlinLogging
abstract class CKLogger(logger: KLogger) : KLogger by logger {
constructor(func: () -> Unit) : this(kLogger(func))
}
fun kLogger(func: () -> Unit) = KotlinLogging.logger(func)

View File

@@ -7,18 +7,15 @@
package ca.gosyer.jui.core.io
import ca.gosyer.jui.core.build.BuildKonfig
import mu.KotlinLogging
import net.harawata.appdirs.AppDirsFactory
import okio.FileSystem
import okio.Path
import okio.Path.Companion.toPath
private val logger = KotlinLogging.logger {}
val userDataDir: Path by lazy {
AppDirsFactory.getInstance().getUserDataDir(BuildKonfig.NAME, null, null).toPath().also {
if (!FileSystem.SYSTEM.exists(it)) {
logger.info("Attempted to create app data dir, result: {}", FileSystem.SYSTEM.createDirectories(it))
FileSystem.SYSTEM.createDirectories(it)
}
}
}