https://kotlinlang.org logo
#ktor
Title
# ktor
b

Barry Fawthrop

03/01/2022, 1:28 AM
I have ktor client in an Android codebase. I have a single apiclient = HttpClient(okhttp) with multiple install() like install(logging). How can I turn logging on and off with a variable passed to apiclient. Like apiclient(true).post(url), thanks
i

ishitatsuyuki

03/01/2022, 1:44 AM
I think an easy way is to use two different clients, one with logging and one without. For anything more complicated you might want to write your own version of logging plugin
👍 1
b

Barry Fawthrop

03/01/2022, 2:46 AM
Thanks
3 Views