From 74eee59879e4a81f3a4156aa2110153745c11356 Mon Sep 17 00:00:00 2001 From: biezhihua Date: Wed, 25 Sep 2024 15:03:42 +0800 Subject: [PATCH] =?UTF-8?q?[android]=20=E5=9B=9E=E6=BB=9A=E5=8E=9F?= =?UTF-8?q?=E6=9C=89=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/kotlin/com/alibaba/gaiax/js/utils/Log.kt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/GaiaXAndroidJS/src/main/kotlin/com/alibaba/gaiax/js/utils/Log.kt b/GaiaXAndroidJS/src/main/kotlin/com/alibaba/gaiax/js/utils/Log.kt index 4fdda3a27..8dae57f4e 100644 --- a/GaiaXAndroidJS/src/main/kotlin/com/alibaba/gaiax/js/utils/Log.kt +++ b/GaiaXAndroidJS/src/main/kotlin/com/alibaba/gaiax/js/utils/Log.kt @@ -22,12 +22,12 @@ object Log { const val TAG = "GaiaX.JS" - fun d(tag: String, msg: String) { - log(DEBUG, tag, msg) + fun d(tag: String?, msg: String) { + log(DEBUG, tag ?: TAG, msg) } - fun e(tag: String, msg: String) { - log(ERROR, tag, msg) + fun e(tag: String?, msg: String) { + log(ERROR, tag ?: TAG, msg) } fun log(type: Int, tag: String, msg: String) { @@ -51,6 +51,13 @@ object Log { log(type, if (tag.isEmpty()) TAG else "${TAG}.${tag}", block()) } } + + /** + * 不可删除、不可修改 + */ + fun isLog(): Boolean { + return defaultLog + } } val defaultLog by lazy {