mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-01 04:47:53 +00:00
android: Convert Log to Kotlin
This commit is contained in:
parent
a05c6deb66
commit
de1dff557d
2 changed files with 42 additions and 39 deletions
|
@ -1,39 +0,0 @@
|
|||
package org.yuzu.yuzu_emu.utils;
|
||||
|
||||
import org.yuzu.yuzu_emu.BuildConfig;
|
||||
|
||||
/**
|
||||
* Contains methods that call through to {@link android.util.Log}, but
|
||||
* with the same TAG automatically provided. Also no-ops VERBOSE and DEBUG log
|
||||
* levels in release builds.
|
||||
*/
|
||||
public final class Log {
|
||||
private static final String TAG = "Yuzu Frontend";
|
||||
|
||||
private Log() {
|
||||
}
|
||||
|
||||
public static void verbose(String message) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
android.util.Log.v(TAG, message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void debug(String message) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
android.util.Log.d(TAG, message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void info(String message) {
|
||||
android.util.Log.i(TAG, message);
|
||||
}
|
||||
|
||||
public static void warning(String message) {
|
||||
android.util.Log.w(TAG, message);
|
||||
}
|
||||
|
||||
public static void error(String message) {
|
||||
android.util.Log.e(TAG, message);
|
||||
}
|
||||
}
|
42
src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.kt
Normal file
42
src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.kt
Normal file
|
@ -0,0 +1,42 @@
|
|||
package org.yuzu.yuzu_emu.utils
|
||||
|
||||
import android.util.Log
|
||||
import org.yuzu.yuzu_emu.BuildConfig
|
||||
|
||||
/**
|
||||
* Contains methods that call through to [android.util.Log], but
|
||||
* with the same TAG automatically provided. Also no-ops VERBOSE and DEBUG log
|
||||
* levels in release builds.
|
||||
*/
|
||||
object Log {
|
||||
private const val TAG = "Yuzu Frontend"
|
||||
|
||||
@JvmStatic
|
||||
fun verbose(message: String) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.v(TAG, message)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun debug(message: String) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, message)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun info(message: String) {
|
||||
Log.i(TAG, message)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun warning(message: String) {
|
||||
Log.w(TAG, message)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun error(message: String) {
|
||||
Log.e(TAG, message)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue