diff --git a/src/main/java/de/bixilon/minosoft/commands/stack/print/PrintTarget.kt b/src/main/java/de/bixilon/minosoft/commands/stack/print/PrintTarget.kt index 8b2206a1c..c7c2318bc 100644 --- a/src/main/java/de/bixilon/minosoft/commands/stack/print/PrintTarget.kt +++ b/src/main/java/de/bixilon/minosoft/commands/stack/print/PrintTarget.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2022 Moritz Zwerger + * Copyright (C) 2020-2024 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -13,7 +13,7 @@ package de.bixilon.minosoft.commands.stack.print -interface PrintTarget { +fun interface PrintTarget { fun print(message: Any) } diff --git a/src/main/java/de/bixilon/minosoft/gui/eros/dialog/UpdateAvailableDialog.kt b/src/main/java/de/bixilon/minosoft/gui/eros/dialog/UpdateAvailableDialog.kt index 594e48f38..9ad071d69 100644 --- a/src/main/java/de/bixilon/minosoft/gui/eros/dialog/UpdateAvailableDialog.kt +++ b/src/main/java/de/bixilon/minosoft/gui/eros/dialog/UpdateAvailableDialog.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2024 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -24,6 +24,9 @@ import de.bixilon.minosoft.gui.eros.util.JavaFXUtil.text import de.bixilon.minosoft.updater.MinosoftUpdate import de.bixilon.minosoft.updater.MinosoftUpdater import de.bixilon.minosoft.updater.UpdateProgress +import de.bixilon.minosoft.util.logging.Log +import de.bixilon.minosoft.util.logging.LogLevels +import de.bixilon.minosoft.util.logging.LogMessageType import de.bixilon.minosoft.util.system.SystemUtil import javafx.fxml.FXML import javafx.scene.control.Button @@ -87,7 +90,7 @@ class UpdateAvailableDialog( @FXML fun update() { - val progress = UpdateProgress() + val progress = UpdateProgress(log = { Log.log(LogMessageType.OTHER, LogLevels.INFO, it) }) MinosoftUpdater.download(update, progress) // TODO: Show progress } diff --git a/src/main/java/de/bixilon/minosoft/util/logging/Log.kt b/src/main/java/de/bixilon/minosoft/util/logging/Log.kt index 26dcbbe33..40e4eceec 100644 --- a/src/main/java/de/bixilon/minosoft/util/logging/Log.kt +++ b/src/main/java/de/bixilon/minosoft/util/logging/Log.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2024 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -183,6 +183,11 @@ object Log { log(type, level = level, additionalPrefix = null, messageBuilder = messageBuilder) } + inline fun log(type: LogMessageType, level: LogLevels, message: Any?) { + log(type, level, null, message) + } + + @JvmStatic fun log(type: LogMessageType, messageBuilder: () -> Any?) { contract {