Skip to content

Commit

Permalink
Fixed: Ensure custom log level doesn't log if its off or null
Browse files Browse the repository at this point in the history
  • Loading branch information
agnostic-apollo committed Sep 4, 2021
1 parent bc779d2 commit 197979f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ public static boolean isLogLevelValid(Integer logLevel) {
/** Check if custom log level is valid and >= {@link #CURRENT_LOG_LEVEL}. If custom log level is
* not valid then {@link #LOG_LEVEL_VERBOSE} must be >= {@link #CURRENT_LOG_LEVEL}. */
public static boolean shouldEnableLoggingForCustomLogLevel(Integer customLogLevel) {
if (customLogLevel == null || CURRENT_LOG_LEVEL == LOG_LEVEL_OFF) return false;
customLogLevel = Logger.isLogLevelValid(customLogLevel) ? customLogLevel: Logger.LOG_LEVEL_VERBOSE;
return (customLogLevel >= CURRENT_LOG_LEVEL);
}
Expand Down

0 comments on commit 197979f

Please sign in to comment.