@@ -156,7 +156,7 @@ public <X> CompletableFuture<X> send(SessionID sessionId, Command<X> command) {
156156 try (JsonOutput out = JSON .newOutput (json ).writeClassName (false )) {
157157 out .write (serialized .build ());
158158 }
159- LOG .log (getDebugLogLevel (), () -> String . format ( "-> %s " , json ) );
159+ LOG .log (getDebugLogLevel (), "-> {0} " , json );
160160 socket .sendText (json );
161161
162162 if (!command .getSendsResponse ()) {
@@ -236,7 +236,7 @@ private void handle(CharSequence data) {
236236 // TODO: decode once, and once only
237237
238238 String asString = String .valueOf (data );
239- LOG .log (getDebugLogLevel (), () -> String . format ( "<- %s " , asString ) );
239+ LOG .log (getDebugLogLevel (), "<- {0} " , asString );
240240
241241 Map <String , Object > raw = JSON .toType (asString , MAP_TYPE );
242242 if (raw .get ("id" ) instanceof Number
@@ -270,9 +270,8 @@ private void handle(CharSequence data) {
270270 } else if (raw .get ("method" ) instanceof String && raw .get ("params" ) instanceof Map ) {
271271 LOG .log (
272272 getDebugLogLevel (),
273- String .format (
274- "Method %s called with %d callbacks available" ,
275- raw .get ("method" ), eventCallbacks .keySet ().size ()));
273+ "Method {0} called with {1} callbacks available" ,
274+ new Object [] { raw .get ("method" ), eventCallbacks .keySet ().size () });
276275 Lock lock = callbacksLock .readLock ();
277276 lock .lock ();
278277 try {
@@ -282,7 +281,8 @@ private void handle(CharSequence data) {
282281 event ->
283282 LOG .log (
284283 getDebugLogLevel (),
285- String .format ("Matching %s with %s" , raw .get ("method" ), event .getMethod ())))
284+ "Matching {0} with {1}" ,
285+ new Object []{ raw .get ("method" ), event .getMethod ()}))
286286 .filter (event -> raw .get ("method" ).equals (event .getMethod ()))
287287 .forEach (
288288 event -> {
@@ -316,9 +316,8 @@ private void handle(CharSequence data) {
316316 Consumer <Object > obj = (Consumer <Object >) action ;
317317 LOG .log (
318318 getDebugLogLevel (),
319- String .format (
320- "Calling callback for %s using %s being passed %s" ,
321- event , obj , finalValue ));
319+ "Calling callback for {0} using {1} being passed {2}" ,
320+ new Object [] { event , obj , finalValue });
322321 obj .accept (finalValue );
323322 }
324323 }
0 commit comments