Merge branch 'dev_robotaxi-d_231031_6.2.0' into 6.2.0_merge_master
# Conflicts: # core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package com.mogo.eagle.core.utilcode.util
|
||||
|
||||
import android.util.Log
|
||||
import com.apm.insight.log.VLog
|
||||
|
||||
class VLogUtils {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun d(tag: String, msg: String, max: Int = 4096) {
|
||||
handleMsg(msg, max).forEach {
|
||||
VLog.d(tag, it)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun v(tag: String, msg: String, max: Int = 4096) {
|
||||
handleMsg(msg, max).forEach {
|
||||
VLog.v(tag, it)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun w(tag: String, msg: String, max: Int = 4096) {
|
||||
handleMsg(msg, max).forEach {
|
||||
VLog.w(tag, it)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun e(tag: String, msg: String, max: Int = 4096) {
|
||||
handleMsg(msg, max).forEach {
|
||||
VLog.e(tag, it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleMsg(msg: String, max: Int = 4096): List<String> {
|
||||
val result = ArrayList<String>()
|
||||
try {
|
||||
var left = msg.length
|
||||
var begin = 0
|
||||
while (left > max) {
|
||||
val part = msg.substring(begin, begin + max)
|
||||
result += part
|
||||
begin += max
|
||||
left -= max
|
||||
}
|
||||
if (left > 0) {
|
||||
result += msg.substring(begin, begin + left)
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
Log.e(TAG, "error", t)
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user