Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Document usage with Ktor #34

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading