Log the reason that led Devtools to restart the app

See gh-28495
pull/29200/head
Artur Signell 3 years ago committed by Stephane Nicoll
parent a0d4651a04
commit 0769b33e2e

@ -18,6 +18,9 @@ package org.springframework.boot.devtools.classpath;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.devtools.filewatch.ChangedFile;
import org.springframework.boot.devtools.filewatch.ChangedFiles;
import org.springframework.boot.devtools.filewatch.FileChangeListener;
@ -35,6 +38,8 @@ import org.springframework.util.Assert;
*/
class ClassPathFileChangeListener implements FileChangeListener {
private static final Log logger = LogFactory.getLog(ClassPathFileChangeListener.class);
private final ApplicationEventPublisher eventPublisher;
private final ClassPathRestartStrategy restartStrategy;
@ -60,6 +65,9 @@ class ClassPathFileChangeListener implements FileChangeListener {
@Override
public void onChange(Set<ChangedFiles> changeSet) {
boolean restart = isRestartRequired(changeSet);
if (restart && logger.isDebugEnabled()) {
logger.debug("Restarting dev tools due to changes in the following files: " + changeSet);
}
publishEvent(new ClassPathChangedEvent(this, changeSet, restart));
}

Loading…
Cancel
Save