From 3fc6fbed85df7f03c2092d5ba624959cb3a8e92f Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 28 Jul 2021 11:45:43 +0800 Subject: [PATCH] Change all system property names `mirai.debug.network.*` to `mirai.network.*` --- .github/workflows/build.yml | 8 ++++---- .github/workflows/release.yml | 4 ++-- .../network/component/ConcurrentComponentStorage.kt | 4 ++-- .../commonMain/kotlin/network/components/PacketCodec.kt | 2 +- .../kotlin/network/components/PacketLoggingStrategy.kt | 4 ++-- .../selector/AbstractKeepAliveNetworkHandlerSelector.kt | 3 ++- .../kotlin/network/handler/state/LoggingStateObserver.kt | 2 +- .../src/commonTest/kotlin/test/initPlatform.common.kt | 8 ++++---- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a20c43ce..decd5f546 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,9 +27,9 @@ jobs: - name: mirai-core Tests run: > ./gradlew check --scan - -Dmirai.debug.network.show.all.components=true + -Dmirai.network.show.all.components=true -Dkotlinx.coroutines.debug=on - -Dmirai.debug.network.show.packet.details=true + -Dmirai.network.show.packet.details=true build-all: runs-on: ubuntu-latest steps: @@ -56,6 +56,6 @@ jobs: - name: All Tests run: > ./gradlew check --scan - -Dmirai.debug.network.show.all.components=true + -Dmirai.network.show.all.components=true -Dkotlinx.coroutines.debug=on - -Dmirai.debug.network.show.packet.details=true \ No newline at end of file + -Dmirai.network.show.packet.details=true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f2a204af..cbddb30ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,9 +63,9 @@ jobs: - name: Check run: > ./gradlew check --scan - -Dmirai.debug.network.show.all.components=true + -Dmirai.network.show.all.components=true -Dkotlinx.coroutines.debug=on - -Dmirai.debug.network.show.packet.details=true + -Dmirai.network.show.packet.details=true - name: Gradle :mirai-core-utils:publish run: > diff --git a/mirai-core/src/commonMain/kotlin/network/component/ConcurrentComponentStorage.kt b/mirai-core/src/commonMain/kotlin/network/component/ConcurrentComponentStorage.kt index f7e4a7255..2101755e0 100644 --- a/mirai-core/src/commonMain/kotlin/network/component/ConcurrentComponentStorage.kt +++ b/mirai-core/src/commonMain/kotlin/network/component/ConcurrentComponentStorage.kt @@ -64,10 +64,10 @@ internal inline fun ConcurrentComponentStorage(builderAction: ConcurrentComponen return ConcurrentComponentStorage().apply(builderAction) } -private val SHOW_ALL_COMPONENTS: Boolean by lazy(NONE) { systemProp("mirai.debug.network.show.all.components", false) } +private val SHOW_ALL_COMPONENTS: Boolean by lazy(NONE) { systemProp("mirai.network.show.all.components", false) } private val SHOW_COMPONENTS_CREATION_STACKTRACE: Boolean by lazy(NONE) { systemProp( - "mirai.debug.network.show.components.creation.stacktrace", + "mirai.network.show.components.creation.stacktrace", false ) } \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/network/components/PacketCodec.kt b/mirai-core/src/commonMain/kotlin/network/components/PacketCodec.kt index d1fcd73f6..b55e59237 100644 --- a/mirai-core/src/commonMain/kotlin/network/components/PacketCodec.kt +++ b/mirai-core/src/commonMain/kotlin/network/components/PacketCodec.kt @@ -42,7 +42,7 @@ internal interface PacketCodec { suspend fun processBody(bot: QQAndroidBot, input: RawIncomingPacket): IncomingPacket? companion object : ComponentKey { - val PACKET_DEBUG = systemProp("mirai.debug.network.packet.logger", false) + val PACKET_DEBUG = systemProp("mirai.network.packet.logger", false) internal val PacketLogger: MiraiLoggerWithSwitch by lazy { MiraiLogger.create("Packet").withSwitch(PACKET_DEBUG) diff --git a/mirai-core/src/commonMain/kotlin/network/components/PacketLoggingStrategy.kt b/mirai-core/src/commonMain/kotlin/network/components/PacketLoggingStrategy.kt index 189fe64c2..5444949db 100644 --- a/mirai-core/src/commonMain/kotlin/network/components/PacketLoggingStrategy.kt +++ b/mirai-core/src/commonMain/kotlin/network/components/PacketLoggingStrategy.kt @@ -90,7 +90,7 @@ internal class PacketLoggingStrategyImpl( companion object { fun getDefaultBlacklist(): Set { - if (systemProp("mirai.debug.network.show.verbose.packets", false)) return emptySet() + if (systemProp("mirai.network.show.verbose.packets", false)) return emptySet() return DEFAULT_BLACKLIST } @@ -112,6 +112,6 @@ internal class PacketLoggingStrategyImpl( } @JvmField - var SHOW_PACKET_DETAILS = systemProp("mirai.debug.network.show.packet.details", false) + var SHOW_PACKET_DETAILS = systemProp("mirai.network.show.packet.details", false) } } diff --git a/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt b/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt index 17a29b6b7..ef2a6c26e 100644 --- a/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt +++ b/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt @@ -199,7 +199,8 @@ internal abstract class AbstractKeepAliveNetworkHandlerSelector