Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit e8bc3e9

Browse files
committed
refactor(velocity): replace println with structured logging for server registration and unregistration
1 parent 5ff5fd9 commit e8bc3e9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

surf-cloud-velocity/src/main/kotlin/dev/slne/surf/cloud/velocity/netty/network/VelocitySpecificPacketListenerExtension.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import dev.slne.surf.cloud.core.common.netty.network.protocol.running.Registrati
1313
import dev.slne.surf.cloud.core.common.netty.network.protocol.running.ServerboundTransferPlayerPacketResponse.Status
1414
import dev.slne.surf.cloud.velocity.proxy
1515
import dev.slne.surf.cloud.velocity.reflection.VelocityConfigurationProxy
16+
import dev.slne.surf.surfapi.core.api.util.logger
1617
import kotlinx.coroutines.flow.launchIn
1718
import kotlinx.coroutines.flow.onEach
1819
import kotlinx.coroutines.future.await
@@ -24,6 +25,8 @@ import org.springframework.stereotype.Component as SpringComponent
2425

2526
@SpringComponent
2627
class VelocitySpecificPacketListenerExtension : PlatformSpecificPacketListenerExtension {
28+
private val log = logger()
29+
2730
override val playAddress: InetSocketAddress
2831
get() = proxy.boundAddress
2932

@@ -74,14 +77,15 @@ class VelocitySpecificPacketListenerExtension : PlatformSpecificPacketListenerEx
7477

7578
override fun registerCloudServerToProxy(client: ClientCloudServerImpl) {
7679
val serverInfo = ServerInfo(client.name, client.playAddress)
77-
println("Registering server $serverInfo to proxy")
78-
80+
log.atInfo()
81+
.log("Registering server %s to proxy", serverInfo)
7982
proxy.registerServer(serverInfo)
8083
}
8184

8285
override fun unregisterCloudServerFromProxy(client: ClientCloudServerImpl) {
8386
val info = ServerInfo(client.name, client.playAddress)
84-
println("Unregistering server $info from proxy")
87+
log.atInfo()
88+
.log("Unregistering server %s from proxy", info)
8589
proxy.unregisterServer(info)
8690
}
8791

0 commit comments

Comments
 (0)