Skip to content

Commit

Permalink
KTOR-7326 Remove debug implementation of Pipeline.toString (#4419)
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd authored Oct 29, 2024
1 parent 4f45166 commit 0ae547f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 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
10 changes: 4 additions & 6 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,11 +253,9 @@ public open class Pipeline<TSubject : Any, TContext : Any>(
fastPathMerge(from)
}

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

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

internal fun phaseInterceptors(phase: PipelinePhase): List<PipelineInterceptor<TSubject, TContext>> =
Expand Down

0 comments on commit 0ae547f

Please sign in to comment.