diff options
author | Arne Schwabe <arne@rfc2549.org> | 2023-11-24 15:51:27 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2023-11-24 15:51:27 +0100 |
commit | 2544bd3963fd489ed7b38bdaf293a662f2995382 (patch) | |
tree | 86f6ed7e5ddf697fc5aeccc17b7dd9dcb667fe9e /main/src | |
parent | 823cb52eff9934d36214af161759580bac589fdf (diff) |
Add @StringRes annotations to VPNStatus log methods
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/LogItem.java | 4 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java index 65714c43..3ec2e438 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java @@ -15,6 +15,8 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; +import androidx.annotation.StringRes; + import java.io.ByteArrayInputStream; import java.io.UnsupportedEncodingException; import java.lang.reflect.Array; @@ -239,7 +241,7 @@ public class LogItem implements Parcelable { } }; - public LogItem(VpnStatus.LogLevel loglevel, int ressourceId, Object... args) { + public LogItem(VpnStatus.LogLevel loglevel, @StringRes int ressourceId, Object... args) { mRessourceId = ressourceId; mArgs = args; mLevel = loglevel; diff --git a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java index d1814fc2..fb55cba3 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java +++ b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java @@ -11,6 +11,8 @@ import android.os.Build; import android.os.HandlerThread; import android.os.Message; +import androidx.annotation.StringRes; + import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; @@ -408,11 +410,11 @@ public class VpnStatus { newLogItem(new LogItem(LogLevel.DEBUG, message)); } - public static void logInfo(int resourceId, Object... args) { + public static void logInfo(@StringRes int resourceId, Object... args) { newLogItem(new LogItem(LogLevel.INFO, resourceId, args)); } - public static void logDebug(int resourceId, Object... args) { + public static void logDebug(@StringRes int resourceId, Object... args) { newLogItem(new LogItem(LogLevel.DEBUG, resourceId, args)); } @@ -486,7 +488,7 @@ public class VpnStatus { } - public static void logWarning(int resourceId, Object... args) { + public static void logWarning(@StringRes int resourceId, Object... args) { newLogItem(new LogItem(LogLevel.WARNING, resourceId, args)); } @@ -495,11 +497,11 @@ public class VpnStatus { } - public static void logError(int resourceId) { + public static void logError(@StringRes int resourceId) { newLogItem(new LogItem(LogLevel.ERROR, resourceId)); } - public static void logError(int resourceId, Object... args) { + public static void logError(@StringRes int resourceId, Object... args) { newLogItem(new LogItem(LogLevel.ERROR, resourceId, args)); } |