com.hina.analytics.android.plugin.utils.Logger.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of auto-plugin Show documentation
Show all versions of auto-plugin Show documentation
The official Android SDK Plugin for Hina Data Track.
The newest version!
package com.hina.analytics.android.plugin.utils
import com.hina.analytics.android.plugin.common.VersionConstant
object Logger {
var debug = false
/**
* 打印提示信息
*/
fun printCopyright() {
if (debug) {
println()
println("${LogUI.C_BLACK_GREEN.value}####################################################################${LogUI.E_NORMAL.value}")
println("${LogUI.C_BLACK_GREEN.value}### ###${LogUI.E_NORMAL.value}")
println("${LogUI.C_BLACK_GREEN.value}### ###${LogUI.E_NORMAL.value}")
println("${LogUI.C_BLACK_GREEN.value}### 欢迎使用 HinaAnalytics® (v${VersionConstant.VERSION} 编译插件) ###${LogUI.E_NORMAL.value}")
println("${LogUI.C_BLACK_GREEN.value}### ###${LogUI.E_NORMAL.value}")
println("${LogUI.C_BLACK_GREEN.value}### ###${LogUI.E_NORMAL.value}")
println("${LogUI.C_BLACK_GREEN.value}####################################################################${LogUI.E_NORMAL.value}")
println()
} else {
println("${LogUI.C_BLACK_GREEN.value}HinaAnalytics Plugin v${VersionConstant.VERSION}${LogUI.E_NORMAL.value}")
}
}
fun error(msg: Any) {
try {
println("${LogUI.C_ERROR.value}[HinaAnalytics]: $msg")
} catch (e: Exception) {
e.printStackTrace()
}
}
fun warn(msg: Any) {
if (debug) {
try {
println("${LogUI.C_WARN.value}[HinaAnalytics]: $msg")
} catch (e: Exception) {
e.printStackTrace()
}
}
}
/**
* 打印日志
*/
fun info(msg: Any) {
if (debug) {
try {
println("[HinaAnalytics]: $msg")
} catch (e: Exception) {
e.printStackTrace()
}
}
}
fun printNoLimit(msg: String) {
try {
println("$msg")
} catch (e: Exception) {
e.printStackTrace()
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy