Skip to content

Commit

Permalink
README: Document usage with Ktor
Browse files Browse the repository at this point in the history
  • Loading branch information
saschpe committed Mar 5, 2024
1 parent f4ac8e9 commit f32304c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,26 @@ class MyApplication : Application() {
}
```

## Ktor integration

Ktor supports [providing a custom logger][ktor-logging]:

```kotlin
import io.ktor.client.*
import io.ktor.client.engine.cio.*
import io.ktor.client.plugins.logging.*
import saschpe.log4k.Log

val httpClient = HttpClient(CIO) {
install(Logging) {
level = LogLevel.ALL
logger = object : Logger {
override fun log(message: String) = Log.info { message }
}
}
}
```

## Users

- [Alpha+ Player - Unofficial player for Soma FM](https://play.google.com/store/apps/details?id=saschpe.alphaplus)
Expand All @@ -150,4 +170,6 @@ class MyApplication : Application() {
See the License for the specific language governing permissions and
limitations under the License.

[ktor-logging]: https://ktor.io/docs/client-logging.html#custom_logger

[maven-central]: https://search.maven.org/artifact/de.peilicke.sascha/android-customtabs

0 comments on commit f32304c

Please sign in to comment.