import org.picocontainer.Startable;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.MessageException;
+import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.process.ProcessProperties;
import org.sonar.server.platform.db.migration.version.DatabaseVersion;
String msg = "The database must be manually upgraded. Please backup the database and browse /setup. "
+ "For more information: https://docs.sonarqube.org/latest/setup/upgrading";
Loggers.get(DatabaseServerCompatibility.class).warn(msg);
- Loggers.get(STARTUP_LOGGER_NAME).warn('\n'
- + HIGHLIGHTER + '\n'
- + " " + msg
- + '\n' + HIGHLIGHTER);
+ Logger logger = Loggers.get(STARTUP_LOGGER_NAME);
+ logger.warn(HIGHLIGHTER);
+ logger.warn(msg);
+ logger.warn(HIGHLIGHTER);
}
}
}
when(version.getVersion()).thenReturn(Optional.of(DatabaseVersion.MIN_UPGRADE_VERSION));
new DatabaseServerCompatibility(version, settings.asConfig()).start();
- assertThat(logTester.logs()).hasSize(2);
+ assertThat(logTester.logs()).hasSize(4);
assertThat(logTester.logs(LoggerLevel.WARN)).contains(
"The database must be manually upgraded. Please backup the database and browse /setup. "
+ "For more information: https://docs.sonarqube.org/latest/setup/upgrading",
- "\n################################################################################\n" +
- " The database must be manually upgraded. Please backup the database and browse /setup. "
- + "For more information: https://docs.sonarqube.org/latest/setup/upgrading\n" +
+ "################################################################################",
+ "The database must be manually upgraded. Please backup the database and browse /setup. "
+ + "For more information: https://docs.sonarqube.org/latest/setup/upgrading",
"################################################################################");
}