Example usage for org.springframework.boot.autoconfigure.condition ConditionEvaluationReport getDelta

List of usage examples for org.springframework.boot.autoconfigure.condition ConditionEvaluationReport getDelta

Introduction

In this page you can find the example usage for org.springframework.boot.autoconfigure.condition ConditionEvaluationReport getDelta.

Prototype

public ConditionEvaluationReport getDelta(ConditionEvaluationReport previousReport) 

Source Link

Usage

From source file:org.springframework.boot.devtools.autoconfigure.ConditionEvaluationDeltaLoggingListener.java

@Override
public void onApplicationEvent(ApplicationReadyEvent event) {
    ConditionEvaluationReport report = event.getApplicationContext().getBean(ConditionEvaluationReport.class);
    if (previousReport != null) {
        ConditionEvaluationReport delta = report.getDelta(previousReport);
        if (!delta.getConditionAndOutcomesBySource().isEmpty() || !delta.getExclusions().isEmpty()
                || !delta.getUnconditionalClasses().isEmpty()) {
            if (this.logger.isInfoEnabled()) {
                this.logger.info("Condition evaluation delta:"
                        + new ConditionEvaluationReportMessage(delta, "CONDITION EVALUATION DELTA"));
            }//from  ww  w.  j  av  a 2 s.c o  m
        } else {
            this.logger.info("Condition evaluation unchanged");
        }
    }
    previousReport = report;
}