diff options
| author | 2023-03-11 00:38:09 -0500 | |
|---|---|---|
| committer | 2023-06-03 00:05:41 -0700 | |
| commit | de1dff557dcb6af28623c89cccfd58fd80eb41ed (patch) | |
| tree | 2938211629a87c414326cf769585462922fa25be /src/android | |
| parent | android: Convert GpuDriverMetadata to Kotlin (diff) | |
| download | yuzu-de1dff557dcb6af28623c89cccfd58fd80eb41ed.tar.gz yuzu-de1dff557dcb6af28623c89cccfd58fd80eb41ed.tar.xz yuzu-de1dff557dcb6af28623c89cccfd58fd80eb41ed.zip | |
android: Convert Log to Kotlin
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.java | 39 | ||||
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.kt | 42 |
2 files changed, 42 insertions, 39 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.java deleted file mode 100644 index ccf54138d..000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.java +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | package org.yuzu.yuzu_emu.utils; | ||
| 2 | |||
| 3 | import org.yuzu.yuzu_emu.BuildConfig; | ||
| 4 | |||
| 5 | /** | ||
| 6 | * Contains methods that call through to {@link android.util.Log}, but | ||
| 7 | * with the same TAG automatically provided. Also no-ops VERBOSE and DEBUG log | ||
| 8 | * levels in release builds. | ||
| 9 | */ | ||
| 10 | public final class Log { | ||
| 11 | private static final String TAG = "Yuzu Frontend"; | ||
| 12 | |||
| 13 | private Log() { | ||
| 14 | } | ||
| 15 | |||
| 16 | public static void verbose(String message) { | ||
| 17 | if (BuildConfig.DEBUG) { | ||
| 18 | android.util.Log.v(TAG, message); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | public static void debug(String message) { | ||
| 23 | if (BuildConfig.DEBUG) { | ||
| 24 | android.util.Log.d(TAG, message); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | public static void info(String message) { | ||
| 29 | android.util.Log.i(TAG, message); | ||
| 30 | } | ||
| 31 | |||
| 32 | public static void warning(String message) { | ||
| 33 | android.util.Log.w(TAG, message); | ||
| 34 | } | ||
| 35 | |||
| 36 | public static void error(String message) { | ||
| 37 | android.util.Log.e(TAG, message); | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.kt new file mode 100644 index 000000000..91e778b0e --- /dev/null +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/Log.kt | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | package org.yuzu.yuzu_emu.utils | ||
| 2 | |||
| 3 | import android.util.Log | ||
| 4 | import org.yuzu.yuzu_emu.BuildConfig | ||
| 5 | |||
| 6 | /** | ||
| 7 | * Contains methods that call through to [android.util.Log], but | ||
| 8 | * with the same TAG automatically provided. Also no-ops VERBOSE and DEBUG log | ||
| 9 | * levels in release builds. | ||
| 10 | */ | ||
| 11 | object Log { | ||
| 12 | private const val TAG = "Yuzu Frontend" | ||
| 13 | |||
| 14 | @JvmStatic | ||
| 15 | fun verbose(message: String) { | ||
| 16 | if (BuildConfig.DEBUG) { | ||
| 17 | Log.v(TAG, message) | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | @JvmStatic | ||
| 22 | fun debug(message: String) { | ||
| 23 | if (BuildConfig.DEBUG) { | ||
| 24 | Log.d(TAG, message) | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | @JvmStatic | ||
| 29 | fun info(message: String) { | ||
| 30 | Log.i(TAG, message) | ||
| 31 | } | ||
| 32 | |||
| 33 | @JvmStatic | ||
| 34 | fun warning(message: String) { | ||
| 35 | Log.w(TAG, message) | ||
| 36 | } | ||
| 37 | |||
| 38 | @JvmStatic | ||
| 39 | fun error(message: String) { | ||
| 40 | Log.e(TAG, message) | ||
| 41 | } | ||
| 42 | } | ||