Commit 714c9b98 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 89d903d8
...@@ -51,6 +51,7 @@ import org.springframework.boot.CommandLineRunner; ...@@ -51,6 +51,7 @@ import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.core.log.LogMessage;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.PatternMatchUtils; import org.springframework.util.PatternMatchUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -158,9 +159,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered, ...@@ -158,9 +159,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered,
if (StringUtils.hasText(this.jobNames)) { if (StringUtils.hasText(this.jobNames)) {
String[] jobsToRun = this.jobNames.split(","); String[] jobsToRun = this.jobNames.split(",");
if (!PatternMatchUtils.simpleMatch(jobsToRun, job.getName())) { if (!PatternMatchUtils.simpleMatch(jobsToRun, job.getName())) {
if (logger.isDebugEnabled()) { logger.debug(LogMessage.format("Skipped job: %s", job.getName()));
logger.debug("Skipped job: " + job.getName());
}
continue; continue;
} }
} }
...@@ -180,9 +179,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered, ...@@ -180,9 +179,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered,
execute(job, jobParameters); execute(job, jobParameters);
} }
catch (NoSuchJobException ex) { catch (NoSuchJobException ex) {
if (logger.isDebugEnabled()) { logger.debug(LogMessage.format("No job found in registry for job name: %s", jobName));
logger.debug("No job found in registry for job name: " + jobName);
}
} }
} }
} }
......
...@@ -29,6 +29,7 @@ import java.util.regex.Pattern; ...@@ -29,6 +29,7 @@ import java.util.regex.Pattern;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.core.log.LogMessage;
import org.springframework.util.Base64Utils; import org.springframework.util.Base64Utils;
/** /**
...@@ -68,9 +69,7 @@ class Connection { ...@@ -68,9 +69,7 @@ class Connection {
this.inputStream = new ConnectionInputStream(inputStream); this.inputStream = new ConnectionInputStream(inputStream);
this.outputStream = new ConnectionOutputStream(outputStream); this.outputStream = new ConnectionOutputStream(outputStream);
this.header = this.inputStream.readHeader(); this.header = this.inputStream.readHeader();
if (logger.isDebugEnabled()) { logger.debug(LogMessage.format("Established livereload connection [%s]", this.header));
logger.debug("Established livereload connection [" + this.header + "]");
}
} }
/** /**
...@@ -109,9 +108,7 @@ class Connection { ...@@ -109,9 +108,7 @@ class Connection {
throw new ConnectionClosedException(); throw new ConnectionClosedException();
} }
else if (frame.getType() == Frame.Type.TEXT) { else if (frame.getType() == Frame.Type.TEXT) {
if (logger.isDebugEnabled()) { logger.debug(LogMessage.format("Received LiveReload text frame %s", frame));
logger.debug("Received LiveReload text frame " + frame);
}
} }
else { else {
throw new IOException("Unexpected Frame Type " + frame.getType()); throw new IOException("Unexpected Frame Type " + frame.getType());
......
...@@ -33,6 +33,7 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -33,6 +33,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.core.log.LogMessage;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
...@@ -109,9 +110,7 @@ public class LiveReloadServer { ...@@ -109,9 +110,7 @@ public class LiveReloadServer {
public int start() throws IOException { public int start() throws IOException {
synchronized (this.monitor) { synchronized (this.monitor) {
Assert.state(!isStarted(), "Server already started"); Assert.state(!isStarted(), "Server already started");
if (logger.isDebugEnabled()) { logger.debug(LogMessage.format("Starting live reload server on port %s", this.port));
logger.debug("Starting live reload server on port " + this.port);
}
this.serverSocket = new ServerSocket(this.port); this.serverSocket = new ServerSocket(this.port);
int localPort = this.serverSocket.getLocalPort(); int localPort = this.serverSocket.getLocalPort();
this.listenThread = this.threadFactory.newThread(this::acceptConnections); this.listenThread = this.threadFactory.newThread(this::acceptConnections);
......
...@@ -30,6 +30,7 @@ import org.springframework.context.ConfigurableApplicationContext; ...@@ -30,6 +30,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.EnvironmentAware; import org.springframework.context.EnvironmentAware;
import org.springframework.core.annotation.AnnotationAwareOrderComparator; import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.core.log.LogMessage;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils; import org.springframework.util.ReflectionUtils;
...@@ -113,9 +114,7 @@ final class FailureAnalyzers implements SpringBootExceptionReporter { ...@@ -113,9 +114,7 @@ final class FailureAnalyzers implements SpringBootExceptionReporter {
} }
} }
catch (Throwable ex) { catch (Throwable ex) {
if (logger.isDebugEnabled()) { logger.debug(LogMessage.format("FailureAnalyzer %s failed", analyzer), ex);
logger.debug("FailureAnalyzer " + analyzer + " failed", ex);
}
} }
} }
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment