Skip to content

Commit

Permalink
KTOR-7326 Remove debug implementation of Pipeline.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Oct 21, 2024
1 parent 3d71a28 commit d5e8163
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2023 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package io.ktor.server.plugins.calllogging
Expand Down Expand Up @@ -77,19 +77,13 @@ class CallLoggingTest {

assertTrue(messages.size >= 3, "It should be at least 3 message logged:\n$messages")
val startingMessageIndex = messages.indexOfFirst {
it.startsWith(
"INFO: Application started: class io.ktor.server.application.Application(0x$hash)"
)
it == "INFO: Application started: io.ktor.server.application.Application@$hash"
}
val stoppingMessageIndex = messages.indexOfFirst {
it.startsWith(
"INFO: Application stopping: class io.ktor.server.application.Application(0x$hash)"
)
it == "INFO: Application stopping: io.ktor.server.application.Application@$hash"
}
val stoppedMessageIndex = messages.indexOfFirst {
it.startsWith(
"INFO: Application stopped: class io.ktor.server.application.Application(0x$hash)"
)
it == "INFO: Application stopped: io.ktor.server.application.Application@$hash"
}
assertTrue { startingMessageIndex >= 0 }
assertTrue { startingMessageIndex < stoppingMessageIndex }
Expand Down
11 changes: 2 additions & 9 deletions ktor-utils/common/src/io/ktor/util/pipeline/Pipeline.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package io.ktor.util.pipeline

Expand Down Expand Up @@ -253,13 +253,6 @@ public open class Pipeline<TSubject : Any, TContext : Any>(
fastPathMerge(from)
}

override fun toString(): String {
val interceptors = interceptorsForTests()
.joinToString("\n") { " " + it::class.toString() }

return "${this::class}(0x${hashCode().toString(16)}) [\n$interceptors\n]"
}

internal fun phaseInterceptors(phase: PipelinePhase): List<PipelineInterceptor<TSubject, TContext>> =
findPhase(phase)?.sharedInterceptors() ?: emptyList()

Expand Down

0 comments on commit d5e8163

Please sign in to comment.