18
18
*/
19
19
20
20
/*
21
- * Copyright (c) 2008, 2022 , Oracle and/or its affiliates. All rights reserved.
21
+ * Copyright (c) 2008, 2023 , Oracle and/or its affiliates. All rights reserved.
22
22
* Portions Copyright (c) 2019, Chris Fraire <[email protected] >.
23
23
*/
24
24
package org .opengrok .indexer .util ;
@@ -184,7 +184,7 @@ public int exec(final boolean reportExceptions, StreamHandler handler) {
184
184
envStr = " with environment: " + envMap .toString ();
185
185
}
186
186
LOGGER .log (Level .FINE ,
187
- "Executing command [{0}] in directory {1}{2}" ,
187
+ "Executing command [{0}] in directory '' {1}'' {2}" ,
188
188
new Object [] {cmd_str , dir_str , envStr });
189
189
190
190
Process process = null ;
@@ -201,7 +201,7 @@ public int exec(final boolean reportExceptions, StreamHandler handler) {
201
201
} catch (IOException ex ) {
202
202
if (reportExceptions ) {
203
203
LOGGER .log (Level .SEVERE ,
204
- "Error while executing command [{0}] in directory {1}" ,
204
+ "Error while executing command [{0}] in directory '' {1}'' " ,
205
205
new Object [] {cmd_str , dir_str });
206
206
LOGGER .log (Level .SEVERE , "Error during process pipe listening" , ex );
207
207
}
@@ -220,7 +220,7 @@ public int exec(final boolean reportExceptions, StreamHandler handler) {
220
220
timer .schedule (new TimerTask () {
221
221
@ Override public void run () {
222
222
LOGGER .log (Level .WARNING ,
223
- String .format ("Terminating process of command [%s] in directory %s " +
223
+ String .format ("Terminating process of command [%s] in directory '%s' " +
224
224
"due to timeout %d seconds" , cmd_str , dir_str , timeout / 1000 ));
225
225
proc .destroy ();
226
226
}
@@ -232,10 +232,10 @@ public int exec(final boolean reportExceptions, StreamHandler handler) {
232
232
ret = process .waitFor ();
233
233
234
234
stat .report (LOGGER , Level .FINE ,
235
- String .format ("Finished command [%s] in directory %s with exit code %d" , cmd_str , dir_str , ret ),
235
+ String .format ("Finished command [%s] in directory '%s' with exit code %d" , cmd_str , dir_str , ret ),
236
236
"executor.latency" );
237
237
LOGGER .log (Level .FINE ,
238
- "Finished command [{0}] in directory {1} with exit code {2}" ,
238
+ "Finished command [{0}] in directory '' {1}'' with exit code {2}" ,
239
239
new Object [] {cmd_str , dir_str , ret });
240
240
241
241
// Wait for the stderr read-out thread to finish the processing and
@@ -272,8 +272,9 @@ public int exec(final boolean reportExceptions, StreamHandler handler) {
272
272
StringBuilder msg = new StringBuilder ("Non-zero exit status " )
273
273
.append (ret ).append (" from command [" )
274
274
.append (cmd_str )
275
- .append ("] in directory " )
276
- .append (dir_str );
275
+ .append ("] in directory '" )
276
+ .append (dir_str ).
277
+ append ("'" );
277
278
if (stderr != null && stderr .length > 0 ) {
278
279
msg .append (": " );
279
280
if (stderr .length > MAX_MSG_SZ ) {
0 commit comments