diff --git a/komga-tray/src/main/kotlin/org/gotson/komga/Utils.kt b/komga-tray/src/main/kotlin/org/gotson/komga/Utils.kt index 020377866..a5edd48e0 100644 --- a/komga-tray/src/main/kotlin/org/gotson/komga/Utils.kt +++ b/komga-tray/src/main/kotlin/org/gotson/komga/Utils.kt @@ -1,9 +1,12 @@ package org.gotson.komga +import mu.KotlinLogging import java.awt.Desktop import java.io.File import java.net.URI +private val logger = KotlinLogging.logger {} + fun openUrl(url: String) { if (Desktop.isDesktopSupported()) Desktop.getDesktop().let { @@ -12,8 +15,12 @@ fun openUrl(url: String) { } fun openExplorer(file: File) { + logger.info { "Try to open explorer for path: $file" } if (Desktop.isDesktopSupported()) Desktop.getDesktop().let { if (it.isSupported(Desktop.Action.BROWSE_FILE_DIR)) it.browseFileDirectory(file) + else logger.warn { "Cannot open explorer: Desktop.Action.BROWSE_FILE_DIR is not supported" } } + else + logger.warn { "Cannot open explorer: Desktop is not supported" } } diff --git a/komga/build.gradle.kts b/komga/build.gradle.kts index 556d384e1..63daf5238 100644 --- a/komga/build.gradle.kts +++ b/komga/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { implementation("org.flywaydb:flyway-core") - implementation("io.github.microutils:kotlin-logging-jvm:3.0.5") + api("io.github.microutils:kotlin-logging-jvm:3.0.5") implementation("io.hawt:hawtio-springboot:2.17.6") implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0")