@@ -65,9 +65,12 @@ public static void processPluginExecutionCommandResult(final Context context, St
6565 }
6666
6767 boolean isPluginExecutionCommandWithPendingResult = executionCommand .isPluginExecutionCommandWithPendingResult ();
68+ boolean isExecutionCommandLoggingEnabled = Logger .shouldEnableLoggingForCustomLogLevel (executionCommand .backgroundCustomLogLevel );
6869
6970 // Log the output. ResultData should not be logged if pending result since ResultSender will do it
70- Logger .logDebugExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , !isPluginExecutionCommandWithPendingResult ));
71+ // or if logging is disabled
72+ Logger .logDebugExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true ,
73+ !isPluginExecutionCommandWithPendingResult , isExecutionCommandLoggingEnabled ));
7174
7275 // If execution command was started by a plugin which expects the result back
7376 if (isPluginExecutionCommandWithPendingResult ) {
@@ -78,11 +81,12 @@ public static void processPluginExecutionCommandResult(final Context context, St
7881 setPluginResultDirectoryVariables (executionCommand );
7982
8083 // Send result to caller
81- error = ResultSender .sendCommandResultData (context , logTag , executionCommand .getCommandIdAndLabelLogString (), executionCommand .resultConfig , executionCommand .resultData );
84+ error = ResultSender .sendCommandResultData (context , logTag , executionCommand .getCommandIdAndLabelLogString (),
85+ executionCommand .resultConfig , executionCommand .resultData , isExecutionCommandLoggingEnabled );
8286 if (error != null ) {
8387 // error will be added to existing Errors
8488 resultData .setStateFailed (error );
85- Logger .logDebugExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true ));
89+ Logger .logDebugExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true , isExecutionCommandLoggingEnabled ));
8690
8791 // Flash and send notification for the error
8892 Logger .showToast (context , ResultData .getErrorsListMinimalString (resultData ), true );
@@ -133,9 +137,11 @@ public static void processPluginExecutionCommandError(final Context context, Str
133137 }
134138
135139 boolean isPluginExecutionCommandWithPendingResult = executionCommand .isPluginExecutionCommandWithPendingResult ();
140+ boolean isExecutionCommandLoggingEnabled = Logger .shouldEnableLoggingForCustomLogLevel (executionCommand .backgroundCustomLogLevel );
136141
137142 // Log the error and any exception. ResultData should not be logged if pending result since ResultSender will do it
138- Logger .logErrorExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , !isPluginExecutionCommandWithPendingResult ));
143+ Logger .logErrorExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true ,
144+ !isPluginExecutionCommandWithPendingResult , isExecutionCommandLoggingEnabled ));
139145
140146 // If execution command was started by a plugin which expects the result back
141147 if (isPluginExecutionCommandWithPendingResult ) {
@@ -146,11 +152,12 @@ public static void processPluginExecutionCommandError(final Context context, Str
146152 setPluginResultDirectoryVariables (executionCommand );
147153
148154 // Send result to caller
149- error = ResultSender .sendCommandResultData (context , logTag , executionCommand .getCommandIdAndLabelLogString (), executionCommand .resultConfig , executionCommand .resultData );
155+ error = ResultSender .sendCommandResultData (context , logTag , executionCommand .getCommandIdAndLabelLogString (),
156+ executionCommand .resultConfig , executionCommand .resultData , isExecutionCommandLoggingEnabled );
150157 if (error != null ) {
151158 // error will be added to existing Errors
152159 resultData .setStateFailed (error );
153- Logger .logErrorExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true ));
160+ Logger .logErrorExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true , isExecutionCommandLoggingEnabled ));
154161 forceNotification = true ;
155162 }
156163
@@ -171,7 +178,7 @@ public static void processPluginExecutionCommandError(final Context context, Str
171178
172179 }
173180
174- /** Set variables which will be used by {@link ResultSender#sendCommandResultData(Context, String, String, ResultConfig, ResultData)}
181+ /** Set variables which will be used by {@link ResultSender#sendCommandResultData(Context, String, String, ResultConfig, ResultData, boolean )}
175182 * to send back the result via {@link ResultConfig#resultPendingIntent}. */
176183 public static void setPluginResultPendingIntentVariables (ExecutionCommand executionCommand ) {
177184 ResultConfig resultConfig = executionCommand .resultConfig ;
@@ -186,7 +193,7 @@ public static void setPluginResultPendingIntentVariables(ExecutionCommand execut
186193 resultConfig .resultErrmsgKey = TERMUX_SERVICE .EXTRA_PLUGIN_RESULT_BUNDLE_ERRMSG ;
187194 }
188195
189- /** Set variables which will be used by {@link ResultSender#sendCommandResultData(Context, String, String, ResultConfig, ResultData)}
196+ /** Set variables which will be used by {@link ResultSender#sendCommandResultData(Context, String, String, ResultConfig, ResultData, boolean )}
190197 * to send back the result by writing it to files in {@link ResultConfig#resultDirectoryPath}. */
191198 public static void setPluginResultDirectoryVariables (ExecutionCommand executionCommand ) {
192199 ResultConfig resultConfig = executionCommand .resultConfig ;
0 commit comments