Commit c3bd03fc authored by Him188's avatar Him188

Improve logs

parent d8290600
...@@ -86,7 +86,7 @@ abstract class BotImpl<N : BotNetworkHandler> constructor( ...@@ -86,7 +86,7 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
if (!_network.isActive) { if (!_network.isActive) {
return@subscribeAlways return@subscribeAlways
} }
bot.logger.info("Connection dropped or lost by server, retrying login") bot.logger.info("Connection dropped by server or lost, retrying login")
tryNTimesOrException(configuration.reconnectionRetryTimes) { tryCount -> tryNTimesOrException(configuration.reconnectionRetryTimes) { tryCount ->
if (tryCount != 0) { if (tryCount != 0) {
...@@ -95,7 +95,10 @@ abstract class BotImpl<N : BotNetworkHandler> constructor( ...@@ -95,7 +95,10 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
network.relogin() network.relogin()
logger.info("Reconnected successfully") logger.info("Reconnected successfully")
return@subscribeAlways return@subscribeAlways
}?.let { throw it } }?.let {
logger.info("Cannot reconnect")
throw it
}
} }
is BotOfflineEvent.Active -> { is BotOfflineEvent.Active -> {
val msg = if (event.cause == null) { val msg = if (event.cause == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment