Skip to content

Commit 3f4ef1a

Browse files
committed
perf: 移除不必要的 api
1 parent 010b19c commit 3f4ef1a

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

library/src/main/java/com/opensource/svgaplayer/utils/log/DefaultLogCat.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,7 @@ class DefaultLogCat : ILogger {
2222
Log.w(tag, msg)
2323
}
2424

25-
override fun error(tag: String, msg: String) {
26-
Log.e(tag, msg)
27-
}
28-
29-
override fun error(tag: String, error: Throwable) {
30-
Log.e(tag, "", error)
31-
}
32-
33-
override fun error(tag: String, msg: String, error: Throwable) {
25+
override fun error(tag: String, msg: String?, error: Throwable?) {
3426
Log.e(tag, msg, error)
3527
}
3628
}

library/src/main/java/com/opensource/svgaplayer/utils/log/ILogger.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ interface ILogger {
88
fun info(tag: String, msg: String)
99
fun debug(tag: String, msg: String)
1010
fun warn(tag: String, msg: String)
11-
fun error(tag: String, msg: String)
12-
fun error(tag: String, error: Throwable)
13-
fun error(tag: String, msg: String, error: Throwable)
11+
fun error(tag: String, msg: String?, error: Throwable?)
1412
}

library/src/main/java/com/opensource/svgaplayer/utils/log/LogUtils.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ internal object LogUtils {
3838
if (!SVGALogger.isLogEnabled()) {
3939
return
4040
}
41-
SVGALogger.getSVGALogger()?.error(tag, msg)
41+
SVGALogger.getSVGALogger()?.error(tag, msg, null)
4242
}
4343

44-
fun error(tag: String = TAG, msg: String, error: Throwable) {
44+
fun error(tag: String, error: Throwable) {
4545
if (!SVGALogger.isLogEnabled()) {
4646
return
4747
}
48-
SVGALogger.getSVGALogger()?.error(tag, msg, error)
48+
SVGALogger.getSVGALogger()?.error(tag, error.message, error)
4949
}
5050

51-
fun error(tag: String, error: Throwable) {
51+
fun error(tag: String = TAG, msg: String, error: Throwable) {
5252
if (!SVGALogger.isLogEnabled()) {
5353
return
5454
}
55-
SVGALogger.getSVGALogger()?.error(tag, error)
55+
SVGALogger.getSVGALogger()?.error(tag, msg, error)
5656
}
5757
}

0 commit comments

Comments
 (0)