Skip to content

Commit

Permalink
add debug log to client builder that prints URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxcapades committed Oct 13, 2022
1 parent 7842e22 commit 445d8b1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "org.veupathdb.lib.s3"
version = "0.3.4+s34k-0.7.1"
version = "0.3.5+s34k-0.7.2"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -36,10 +36,10 @@ dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("stdlib-jdk8"))
implementation("org.slf4j:slf4j-api:1.7.36")
implementation("io.minio:minio:8.4.2")
implementation("io.minio:minio:8.4.5")

@Suppress("GradlePackageVersionRange")
api("org.veupathdb.lib.s3:s34k-core:0.6.1+s34k-0.7.1")
api("org.veupathdb.lib.s3:s34k-core:0.6.1+s34k-0.7.2")

testImplementation(kotlin("test"))
}
Expand Down
22 changes: 17 additions & 5 deletions src/main/kotlin/org/veupathdb/lib/s3/s34k/minio/MClient.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
package org.veupathdb.lib.s3.s34k.minio

import io.minio.MinioClient
import org.slf4j.LoggerFactory
import org.veupathdb.lib.s3.s34k.S3Client
import org.veupathdb.lib.s3.s34k.S3Config
import org.veupathdb.lib.s3.s34k.minio.util.makeUrl

internal class MClient(config: S3Config) : S3Client {

private val client = io.minio.MinioClient.builder()
.region(config.region)
.endpoint(config.makeUrl())
.credentials(config.accessKey, config.secretKey)
.build()
private val logger = LoggerFactory.getLogger(javaClass)

private val client: MinioClient

init {
val url = config.makeUrl()

logger.debug("Creating MinIO client for url: $url")

client = MinioClient.builder()
.region(config.region)
.endpoint(url)
.credentials(config.accessKey, config.secretKey)
.build()
}

override val defaultRegion = config.region

Expand Down
8 changes: 4 additions & 4 deletions test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("stdlib-jdk8"))
implementation("org.slf4j:slf4j-api:1.7.36")
implementation("io.minio:minio:8.4.2")
implementation("io.minio:minio:8.4.5")

implementation("org.veupathdb.lib.s3:s34k-minio:0.3.4+s34k-0.7.1")
implementation("org.veupathdb.lib.s3:s34k-minio:0.3.5+s34k-0.7.2")

implementation("org.apache.logging.log4j:log4j-core:2.17.2")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.2")
implementation("org.apache.logging.log4j:log4j-core:2.19.0")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.19.0")

testImplementation(kotlin("test"))
}
Expand Down

0 comments on commit 445d8b1

Please sign in to comment.