Fixed: Stdin not being logged for background execution commands

This commit is contained in:
agnostic-apollo
2021-08-21 03:40:31 +05:00
parent 6409019a40
commit 486faf7fad
4 changed files with 36 additions and 11 deletions

View File

@@ -26,6 +26,7 @@ public class Logger {
public static final int LOG_LEVEL_VERBOSE = 3; // start logging verbose messages
public static final int DEFAULT_LOG_LEVEL = LOG_LEVEL_NORMAL;
public static final int MAX_LOG_LEVEL = LOG_LEVEL_VERBOSE;
private static int CURRENT_LOG_LEVEL = DEFAULT_LOG_LEVEL;
/**
@@ -413,7 +414,7 @@ public class Logger {
}
public static int setLogLevel(Context context, int logLevel) {
if (logLevel >= LOG_LEVEL_OFF && logLevel <= LOG_LEVEL_VERBOSE)
if (isLogLevelValid(logLevel))
CURRENT_LOG_LEVEL = logLevel;
else
CURRENT_LOG_LEVEL = DEFAULT_LOG_LEVEL;
@@ -431,4 +432,8 @@ public class Logger {
return DEFAULT_LOG_TAG + ":" + tag;
}
public static boolean isLogLevelValid(Integer logLevel) {
return (logLevel != null && logLevel >= LOG_LEVEL_OFF && logLevel <= MAX_LOG_LEVEL);
}
}