Change all system property names mirai.debug.network.* to mirai.network.*

This commit is contained in:
Him188 2021-07-28 11:45:43 +08:00
parent 24d52bbe90
commit 3fc6fbed85
8 changed files with 18 additions and 17 deletions

View File

@ -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
-Dmirai.network.show.packet.details=true

View File

@ -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: >

View File

@ -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
)
}

View File

@ -42,7 +42,7 @@ internal interface PacketCodec {
suspend fun processBody(bot: QQAndroidBot, input: RawIncomingPacket): IncomingPacket?
companion object : ComponentKey<PacketCodec> {
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)

View File

@ -90,7 +90,7 @@ internal class PacketLoggingStrategyImpl(
companion object {
fun getDefaultBlacklist(): Set<String> {
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)
}
}

View File

@ -199,7 +199,8 @@ internal abstract class AbstractKeepAliveNetworkHandlerSelector<H : NetworkHandl
* millis
*/
@JvmField
var RECONNECT_DELAY = systemProp("mirai.network.reconnect.delay", 3000)
var RECONNECT_DELAY = systemProp("mirai.network.reconnect.delay", 3000L)
.coerceIn(0..Long.MAX_VALUE)
@JvmField
var SELECTOR_LOGGING = systemProp("mirai.network.handle.selector.logging", false)

View File

@ -76,7 +76,7 @@ internal class LoggingStateObserver(
* - `full` for logging with stacktrace
*/
var ENABLED = systemProp(
"mirai.debug.network.state.observer.logging",
"mirai.network.state.observer.logging",
"off"
).lowercase()

View File

@ -30,10 +30,10 @@ abstract class AbstractTest {
SynchronizedStdoutLogger(it)
}
System.setProperty("mirai.debug.network.packet.logger", "true")
System.setProperty("mirai.debug.network.state.observer.logging", "true")
System.setProperty("mirai.debug.network.show.all.components", "true")
System.setProperty("mirai.debug.network.show.components.creation.stacktrace", "true")
System.setProperty("mirai.network.packet.logger", "true")
System.setProperty("mirai.network.state.observer.logging", "true")
System.setProperty("mirai.network.show.all.components", "true")
System.setProperty("mirai.network.show.components.creation.stacktrace", "true")
System.setProperty("mirai.network.handle.selector.logging", "true")
}