mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2026-01-19 02:02:34 +01:00
Switch Kotlin-Logging to KmLogging
This commit is contained in:
@@ -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)
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user