@@ -82,11 +82,11 @@ public HttpResponse getSteps(StaplerRequest2 req) throws IOException {
8282 }
8383
8484 private JSONObject getSteps (String nodeId ) throws IOException {
85- logger .debug ("getSteps was passed nodeId '" + nodeId + " '." );
85+ logger .debug ("getSteps was passed nodeId '{} '." , nodeId );
8686 PipelineStepList steps = stepApi .getSteps (nodeId );
8787 String stepsJson = MAPPER .writeValueAsString (steps );
8888 if (logger .isDebugEnabled ()) {
89- logger .debug ("Steps: '" + stepsJson + "'." );
89+ logger .debug ("Steps for {} : '{}'." , nodeId , stepsJson );
9090 }
9191 return JSONObject .fromObject (stepsJson );
9292 }
@@ -105,7 +105,7 @@ protected JSONObject getAllSteps() throws IOException {
105105 PipelineStepList steps = stepApi .getAllSteps ();
106106 String stepsJson = MAPPER .writeValueAsString (steps );
107107 if (logger .isDebugEnabled ()) {
108- logger .debug ("Steps: '" + stepsJson + " '." );
108+ logger .debug ("Steps: '{} '." , stepsJson );
109109 }
110110 return JSONObject .fromObject (stepsJson );
111111 }
@@ -117,7 +117,7 @@ public HttpResponse getConsoleText(StaplerRequest2 req, StaplerResponse2 rsp) th
117117 logger .error ("'consoleText' was not passed 'nodeId'." );
118118 return HttpResponses .errorJSON ("Error getting console text" );
119119 }
120- logger .debug ("getConsoleText was passed node id '" + nodeId + " '." );
120+ logger .debug ("getConsoleText was passed node id '{} '." , nodeId );
121121 // This will be a step, so return its log output.
122122 AnnotatedLargeText <? extends FlowNode > logText = getLogForNode (nodeId );
123123
@@ -165,7 +165,7 @@ public HttpResponse getConsoleOutput(StaplerRequest2 req) throws IOException {
165165 logger .error ("'consoleJson' was not passed 'nodeId'." );
166166 return HttpResponses .errorJSON ("Error getting console json" );
167167 }
168- logger .debug ("getConsoleOutput was passed node id '" + nodeId + " '." );
168+ logger .debug ("getConsoleOutput was passed node id '{} '." , nodeId );
169169 // This will be a step, so return it's log output.
170170 // startByte to start getting data from. If negative will startByte from end of string with
171171 // LOG_THRESHOLD.
@@ -194,18 +194,18 @@ protected JSONObject getConsoleOutputJson(String nodeId, Long requestStartByte)
194194 }
195195 // if startByte is negative make sure we don't try and get a byte before 0.
196196 if (requestStartByte < 0L ) {
197- logger .debug ("consoleJson - requested negative startByte '" + requestStartByte + " '." );
197+ logger .debug ("consoleJson - requested negative startByte '{} '." , requestStartByte );
198198 startByte = textLength + requestStartByte ;
199199 if (startByte < 0L ) {
200- logger .debug ("consoleJson - requested negative startByte '"
201- + requestStartByte
202- + "' out of bounds, starting at 0." );
200+ logger .debug (
201+ "consoleJson - requested negative startByte '{}' out of bounds, starting at 0." ,
202+ requestStartByte );
203203 startByte = 0L ;
204204 }
205205 } else {
206206 startByte = requestStartByte ;
207207 }
208- logger .debug ("Returning '" + ( textLength - startByte ) + " ' bytes from 'getConsoleOutput'." );
208+ logger .debug ("Returning '{} ' bytes from 'getConsoleOutput'." , textLength - startByte );
209209 text = PipelineNodeUtil .convertLogToString (logText , startByte , true );
210210 endByte = textLength ;
211211 }
@@ -254,10 +254,10 @@ private boolean isUnhandledException(String nodeId) throws IOException {
254254
255255 private static long parseIntWithDefault (String s , long defaultValue ) {
256256 try {
257- logger .debug ("Parsing user provided value of '" + s + "'" );
257+ logger .debug ("Parsing user provided value of '{}'" , s );
258258 return Long .parseLong (s );
259259 } catch (NumberFormatException e ) {
260- logger .debug ("Using default value of '" + defaultValue + "'" );
260+ logger .debug ("Using default value of '{}'" , defaultValue );
261261 return defaultValue ;
262262 }
263263 }
0 commit comments