Skip to content

Commit acf8db1

Browse files
committed
chore: curl logging wip
1 parent a076668 commit acf8db1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package dev.suresh.http
2+
3+
import io.github.oshai.kotlinlogging.KLogger
4+
import io.ktor.client.plugins.api.ClientPlugin
5+
import io.ktor.client.plugins.api.createClientPlugin
6+
7+
class CurlLoggingConfig {
8+
var enabled: Boolean = true
9+
var logger: KLogger? = null
10+
}
11+
12+
val CurlLogging: ClientPlugin<CurlLoggingConfig> =
13+
createClientPlugin(name = "CurlLogging", createConfiguration = ::CurlLoggingConfig) {
14+
if (pluginConfig.enabled) {
15+
onRequest { req, _ ->
16+
// pluginConfig.logger.is
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)