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

Network: Add logging for excluded transport modes #626

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions feature/trip-planner/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ kotlin {
dependencies {
implementation(projects.core.appInfo)
implementation(projects.core.di)
implementation(projects.core.log)

implementation(libs.kotlinx.serialization.json)
implementation(libs.ktor.client.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import io.ktor.client.request.get
import io.ktor.http.ParametersBuilder
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import xyz.ksharma.krail.core.log.log
import xyz.ksharma.krail.trip.planner.network.api.model.StopFinderResponse
import xyz.ksharma.krail.trip.planner.network.api.model.StopType
import xyz.ksharma.krail.trip.planner.network.api.model.TripResponse
import xyz.ksharma.krail.trip.planner.network.api.service.stop_finder.StopFinderRequestParams
import xyz.ksharma.krail.trip.planner.network.api.service.trip.TripRequestParams
import kotlin.math.log

class RealTripPlanningService(
private val httpClient: HttpClient,
Expand Down Expand Up @@ -56,11 +56,11 @@ class RealTripPlanningService(
}.body()
}

private inline fun addExcludedTransportModes(
private fun addExcludedTransportModes(
excludeProductClassSet: Set<Int>,
parameters: ParametersBuilder,
) {
println("Exclude - $excludeProductClassSet")
log("Exclude transport mode - $excludeProductClassSet")
parameters.append(TripRequestParams.excludedMeans, "checkbox")

if (excludeProductClassSet.contains(1)) {
Expand Down