]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13618 Remove new lines from db migration log
authorJacek <jacek.poreda@sonarsource.com>
Wed, 15 Jul 2020 07:53:53 +0000 (09:53 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 15 Jul 2020 20:04:52 +0000 (20:04 +0000)
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java

index edf844e9be6ddc813ec21fec3c3e81bc5fbb037e..8060c42036dd2db6783b3ad056b7cff4cd3c04ac 100644 (file)
@@ -23,6 +23,7 @@ import java.util.Optional;
 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;
@@ -58,10 +59,10 @@ public class DatabaseServerCompatibility implements Startable {
         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);
       }
     }
   }
index 5a1138e3338b67b27f51587bcc6d0060fce47917..dc08f17a70f78cd22c66cdaa0c2af9a4ce1d7a4f 100644 (file)
@@ -72,13 +72,13 @@ public class DatabaseServerCompatibilityTest {
     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",
         "################################################################################");
   }