mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-09 12:04:03 +08:00
Fixed: Stdin not being logged for background execution commands
This commit is contained in:
@@ -194,7 +194,7 @@ public class StreamGobbler extends Thread {
|
||||
int currentLogLevel = Logger.getLogLevel();
|
||||
|
||||
int customLogLevel;
|
||||
if (mLlogLevel != null && mLlogLevel >= Logger.LOG_LEVEL_OFF) {
|
||||
if (Logger.isLogLevelValid(mLlogLevel)) {
|
||||
customLogLevel = mLlogLevel;
|
||||
Logger.logVerbose(LOG_TAG, "Using custom log level: " + customLogLevel + ", current log level: " + currentLogLevel);
|
||||
} else {
|
||||
|
@@ -8,6 +8,7 @@ import android.system.OsConstants;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.termux.shared.R;
|
||||
import com.termux.shared.data.DataUtils;
|
||||
import com.termux.shared.models.ExecutionCommand;
|
||||
import com.termux.shared.models.ResultData;
|
||||
import com.termux.shared.models.errors.Errno;
|
||||
@@ -80,7 +81,9 @@ public final class TermuxTask {
|
||||
return null;
|
||||
}
|
||||
|
||||
Logger.logDebug(LOG_TAG, executionCommand.toString());
|
||||
// No need to log stdin if logging is disabled, like for app internal scripts
|
||||
int customLogLevel = Logger.isLogLevelValid(executionCommand.backgroundCustomLogLevel) ? executionCommand.backgroundCustomLogLevel: Logger.LOG_LEVEL_VERBOSE;
|
||||
Logger.logDebug(LOG_TAG, ExecutionCommand.getExecutionInputLogString(executionCommand, true, customLogLevel >= Logger.getLogLevel()));
|
||||
|
||||
String taskName = ShellUtils.getExecutableBasename(executionCommand.executable);
|
||||
|
||||
@@ -146,7 +149,7 @@ public final class TermuxTask {
|
||||
STDOUT.start();
|
||||
STDERR.start();
|
||||
|
||||
if (mExecutionCommand.stdin != null && !mExecutionCommand.stdin.isEmpty()) {
|
||||
if (!DataUtils.isNullOrEmpty(mExecutionCommand.stdin)) {
|
||||
try {
|
||||
STDIN.write((mExecutionCommand.stdin + "\n").getBytes(StandardCharsets.UTF_8));
|
||||
STDIN.flush();
|
||||
|
Reference in New Issue
Block a user