Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit 97a92a6

Browse files
committed
3.1.0-dev4
1 parent f822c7e commit 97a92a6

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ android {
1717
applicationId "io.github.mzdluo123.mirai.android"
1818
minSdkVersion 26
1919
targetSdkVersion 30
20-
versionCode 42
21-
versionName "3.1.0-dev3"
20+
versionCode 43
21+
versionName "3.1.0-dev4"
2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2323
buildConfigField("String", "COREVERSION", "\"$CORE_VERSION\"")
2424
buildConfigField("String", "CONSOLEVERSION", "\"$CONSOLE_VERSION\"")

app/libs/silk4j-1.0-SNAPSHOT.jar

-3.01 MB
Binary file not shown.

app/src/main/java/io/github/mzdluo123/mirai/android/miraiconsole/MiraiAndroidLogger.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ private enum class LogColor(val color: String) {
2323
ERROR("#DD1C1A")
2424
}
2525

26-
fun logException(err: Throwable) {
26+
fun logException(err: Throwable?) {
27+
if (err == null) {
28+
return
29+
}
2730
val stringWriter = StringWriter()
2831
err.printStackTrace(PrintWriter(stringWriter))
2932
MiraiAndroidLogger.error(stringWriter.toString())
@@ -37,11 +40,12 @@ object MiraiAndroidLogger :
3740
message?.replace(
3841
"\n",
3942
"<br>"
40-
) ?: e
43+
) ?: "发生错误"
4144
}"
4245

4346
synchronized(this) {
4447
logStorage.add(colorLog)
48+
logException(e)
4549
for (i in 0 until BotService.consoleUi.beginBroadcast()) {
4650
try {
4751
BotService.consoleUi.getBroadcastItem(i).newLog(colorLog)
@@ -56,10 +60,7 @@ object MiraiAndroidLogger :
5660

5761
if (BuildConfig.DEBUG || printToSysLog) {
5862
Log.i("MA", log)
59-
if (e != null) {
60-
e.printStackTrace()
61-
logException(e)
62-
}
63+
e?.printStackTrace()
6364

6465
}
6566
}) {
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)