summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-22 21:47:16 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-22 21:47:16 +0200
commit08a3ec8ec388835373b5363cd1219601bfdcc1ad (patch)
tree91d47d9fc8643769500ab159c2c258ea072ccfc9 /src/main/java/at/hannibal2/skyhanni/features/misc
parent707007fa1a00adebec09af4c1efbf8dc55bb852e (diff)
downloadskyhanni-08a3ec8ec388835373b5363cd1219601bfdcc1ad.tar.gz
skyhanni-08a3ec8ec388835373b5363cd1219601bfdcc1ad.tar.bz2
skyhanni-08a3ec8ec388835373b5363cd1219601bfdcc1ad.zip
Hopefully fixed config reset bug and added more logging
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
index 2e3d848b2..10a93753a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
@@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.misc.update
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.features.About
import at.hannibal2.skyhanni.events.ConfigLoadEvent
+import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils
import io.github.moulberry.moulconfig.processor.MoulConfigProcessor
import io.github.moulberry.notenoughupdates.util.MinecraftExecutor
@@ -15,7 +16,7 @@ import java.util.concurrent.CompletableFuture
object UpdateManager {
- private val logger = SkyHanniMod.getLogger("UpdateManager")
+ private val logger = LorenzLogger("update_manager")
private var _activePromise: CompletableFuture<*>? = null
private var activePromise: CompletableFuture<*>?
get() = _activePromise
@@ -67,24 +68,24 @@ object UpdateManager {
updateState = UpdateState.NONE
_activePromise = null
potentialUpdate = null
- logger.info("Reset update state")
+ logger.log("Reset update state")
}
fun checkUpdate() {
if (updateState != UpdateState.NONE) {
- logger.error("Trying to perform update check while another update is already in progress")
+ logger.log("Trying to perform update check while another update is already in progress")
return
}
- logger.info("Starting update check")
+ logger.log("Starting update check")
var updateStream = config.updateStream.get()
if (updateStream == About.UpdateStream.RELEASES && isBetaRelease()) {
updateStream = About.UpdateStream.BETA
}
activePromise = context.checkUpdate(updateStream.stream)
.thenAcceptAsync({
- logger.info("Update check completed")
+ logger.log("Update check completed")
if (updateState != UpdateState.NONE) {
- logger.warn("This appears to be the second update check. Ignoring this one")
+ logger.log("This appears to be the second update check. Ignoring this one")
return@thenAcceptAsync
}
potentialUpdate = it
@@ -97,14 +98,14 @@ object UpdateManager {
fun queueUpdate() {
if (updateState != UpdateState.AVAILABLE) {
- logger.error("Trying to enqueue an update while another one is already downloaded or none is present")
+ logger.log("Trying to enqueue an update while another one is already downloaded or none is present")
}
updateState = UpdateState.QUEUED
activePromise = CompletableFuture.supplyAsync {
- logger.info("Update download started")
+ logger.log("Update download started")
potentialUpdate!!.prepareUpdate()
}.thenAcceptAsync({
- logger.info("Update download completed, setting exit hook")
+ logger.log("Update download completed, setting exit hook")
updateState = UpdateState.DOWNLOADED
potentialUpdate!!.executeUpdate()
}, MinecraftExecutor.OnThread)