@@ -65,9 +65,12 @@ public static void processPluginExecutionCommandResult(final Context context, St
65
65
}
66
66
67
67
boolean isPluginExecutionCommandWithPendingResult = executionCommand .isPluginExecutionCommandWithPendingResult ();
68
+ boolean isExecutionCommandLoggingEnabled = Logger .shouldEnableLoggingForCustomLogLevel (executionCommand .backgroundCustomLogLevel );
68
69
69
70
// 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 ));
71
74
72
75
// If execution command was started by a plugin which expects the result back
73
76
if (isPluginExecutionCommandWithPendingResult ) {
@@ -78,11 +81,12 @@ public static void processPluginExecutionCommandResult(final Context context, St
78
81
setPluginResultDirectoryVariables (executionCommand );
79
82
80
83
// 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 );
82
86
if (error != null ) {
83
87
// error will be added to existing Errors
84
88
resultData .setStateFailed (error );
85
- Logger .logDebugExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true ));
89
+ Logger .logDebugExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true , isExecutionCommandLoggingEnabled ));
86
90
87
91
// Flash and send notification for the error
88
92
Logger .showToast (context , ResultData .getErrorsListMinimalString (resultData ), true );
@@ -133,9 +137,11 @@ public static void processPluginExecutionCommandError(final Context context, Str
133
137
}
134
138
135
139
boolean isPluginExecutionCommandWithPendingResult = executionCommand .isPluginExecutionCommandWithPendingResult ();
140
+ boolean isExecutionCommandLoggingEnabled = Logger .shouldEnableLoggingForCustomLogLevel (executionCommand .backgroundCustomLogLevel );
136
141
137
142
// 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 ));
139
145
140
146
// If execution command was started by a plugin which expects the result back
141
147
if (isPluginExecutionCommandWithPendingResult ) {
@@ -146,11 +152,12 @@ public static void processPluginExecutionCommandError(final Context context, Str
146
152
setPluginResultDirectoryVariables (executionCommand );
147
153
148
154
// 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 );
150
157
if (error != null ) {
151
158
// error will be added to existing Errors
152
159
resultData .setStateFailed (error );
153
- Logger .logErrorExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true ));
160
+ Logger .logErrorExtended (logTag , ExecutionCommand .getExecutionOutputLogString (executionCommand , true , true , isExecutionCommandLoggingEnabled ));
154
161
forceNotification = true ;
155
162
}
156
163
@@ -171,7 +178,7 @@ public static void processPluginExecutionCommandError(final Context context, Str
171
178
172
179
}
173
180
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 )}
175
182
* to send back the result via {@link ResultConfig#resultPendingIntent}. */
176
183
public static void setPluginResultPendingIntentVariables (ExecutionCommand executionCommand ) {
177
184
ResultConfig resultConfig = executionCommand .resultConfig ;
@@ -186,7 +193,7 @@ public static void setPluginResultPendingIntentVariables(ExecutionCommand execut
186
193
resultConfig .resultErrmsgKey = TERMUX_SERVICE .EXTRA_PLUGIN_RESULT_BUNDLE_ERRMSG ;
187
194
}
188
195
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 )}
190
197
* to send back the result by writing it to files in {@link ResultConfig#resultDirectoryPath}. */
191
198
public static void setPluginResultDirectoryVariables (ExecutionCommand executionCommand ) {
192
199
ResultConfig resultConfig = executionCommand .resultConfig ;
0 commit comments