Example usage for org.springframework.boot.autoconfigure.logging ConditionEvaluationReportMessage ConditionEvaluationReportMessage

List of usage examples for org.springframework.boot.autoconfigure.logging ConditionEvaluationReportMessage ConditionEvaluationReportMessage

Introduction

In this page you can find the example usage for org.springframework.boot.autoconfigure.logging ConditionEvaluationReportMessage ConditionEvaluationReportMessage.

Prototype

public ConditionEvaluationReportMessage(ConditionEvaluationReport report) 

Source Link

Usage

From source file:org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener.java

public void logAutoConfigurationReport(boolean isCrashReport) {
    if (this.report == null) {
        if (this.applicationContext == null) {
            this.logger.info("Unable to provide the conditions report " + "due to missing ApplicationContext");
            return;
        }//from w  ww .ja va2  s .  c  o m
        this.report = ConditionEvaluationReport.get(this.applicationContext.getBeanFactory());
    }
    if (!this.report.getConditionAndOutcomesBySource().isEmpty()) {
        if (this.getLogLevelForReport().equals(LogLevel.INFO)) {
            if (this.logger.isInfoEnabled()) {
                this.logger.info(new ConditionEvaluationReportMessage(this.report));
            } else if (isCrashReport) {
                logMessage("info");
            }
        } else {
            if (isCrashReport && this.logger.isInfoEnabled() && !this.logger.isDebugEnabled()) {
                logMessage("debug");
            }
            if (this.logger.isDebugEnabled()) {
                this.logger.debug(new ConditionEvaluationReportMessage(this.report));
            }
        }
    }
}