mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-08 11:34:07 +08:00
Added|Changed: Add Logger.logErrorPrivate*()
functions which do not log errors that may contain potentially private info unless log level is debug or higher
Execution commands and other errors that may contain potentially private info should not be logged unless user has explicitly allowed it since apps with `READ_LOGS` permission would be able to read the data. A notification for failed executions commands would still be shown if enabled and required.
This commit is contained in:
@@ -120,6 +120,28 @@ public class Logger {
|
||||
|
||||
|
||||
|
||||
public static void logErrorPrivate(String tag, String message) {
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_DEBUG)
|
||||
logMessage(Log.ERROR, tag, message);
|
||||
}
|
||||
|
||||
public static void logErrorPrivate(String message) {
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_DEBUG)
|
||||
logMessage(Log.ERROR, DEFAULT_LOG_TAG, message);
|
||||
}
|
||||
|
||||
public static void logErrorPrivateExtended(String tag, String message) {
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_DEBUG)
|
||||
logExtendedMessage(Log.ERROR, tag, message);
|
||||
}
|
||||
|
||||
public static void logErrorPrivateExtended(String message) {
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_DEBUG)
|
||||
logExtendedMessage(Log.ERROR, DEFAULT_LOG_TAG, message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void logWarn(String tag, String message) {
|
||||
logMessage(Log.WARN, tag, message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user