Skip to content

Commit 1259a21

Browse files
Changed: Make allowed custom log level added in 60f37bd to be more restrictive
1 parent ac32fbc commit 1259a21

File tree

1 file changed

+1
-1
lines changed
  • termux-shared/src/main/java/com/termux/shared/logger

1 file changed

+1
-1
lines changed

termux-shared/src/main/java/com/termux/shared/logger/Logger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public static boolean isLogLevelValid(Integer logLevel) {
439439
/** Check if custom log level is valid and >= {@link #CURRENT_LOG_LEVEL}. If custom log level is
440440
* not valid then {@link #LOG_LEVEL_VERBOSE} must be >= {@link #CURRENT_LOG_LEVEL}. */
441441
public static boolean shouldEnableLoggingForCustomLogLevel(Integer customLogLevel) {
442-
if (customLogLevel == null || CURRENT_LOG_LEVEL == LOG_LEVEL_OFF) return false;
442+
if (customLogLevel == null || CURRENT_LOG_LEVEL <= LOG_LEVEL_OFF || customLogLevel <= LOG_LEVEL_OFF) return false;
443443
customLogLevel = Logger.isLogLevelValid(customLogLevel) ? customLogLevel: Logger.LOG_LEVEL_VERBOSE;
444444
return (customLogLevel >= CURRENT_LOG_LEVEL);
445445
}

0 commit comments

Comments
 (0)