From 26f9eac8d4958455c06c2c6e97c12c19c1666dfd Mon Sep 17 00:00:00 2001 From: Sergeev Viktor Date: Thu, 24 Jun 2021 08:00:09 +0300 Subject: [PATCH 1/2] made the logging of visitors(update/rollback) the same --- .../java/liquibase/changelog/visitor/UpdateVisitor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java b/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java index a1517fed9a1..6b0609ff535 100644 --- a/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java +++ b/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java @@ -10,6 +10,9 @@ import liquibase.database.ObjectQuotingStrategy; import liquibase.exception.LiquibaseException; import liquibase.exception.MigrationFailedException; +import liquibase.executor.Executor; +import liquibase.executor.ExecutorService; +import liquibase.executor.LoggingExecutor; import java.util.Set; @@ -40,6 +43,10 @@ public Direction getDirection() { @Override public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Set filterResults) throws LiquibaseException { + Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database); + if (! (executor instanceof LoggingExecutor)) { + Scope.getCurrentScope().getUI().sendMessage("Running Changeset:" + changeSet); + } ChangeSet.RunStatus runStatus = this.database.getRunStatus(changeSet); Scope.getCurrentScope().getLog(getClass()).fine("Running Changeset:" + changeSet); fireWillRun(changeSet, databaseChangeLog, database, runStatus); From 09c8ec6bd57093b76ab41b2ed739e3b72dc61e97 Mon Sep 17 00:00:00 2001 From: Nathan Voxland Date: Wed, 22 Dec 2021 16:12:03 -0600 Subject: [PATCH 2/2] Added space to update/rollback messages after ":" --- .../java/liquibase/changelog/visitor/RollbackVisitor.java | 2 +- .../main/java/liquibase/changelog/visitor/UpdateVisitor.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/liquibase-core/src/main/java/liquibase/changelog/visitor/RollbackVisitor.java b/liquibase-core/src/main/java/liquibase/changelog/visitor/RollbackVisitor.java index 79b32d88c43..b4259f4a7eb 100644 --- a/liquibase-core/src/main/java/liquibase/changelog/visitor/RollbackVisitor.java +++ b/liquibase-core/src/main/java/liquibase/changelog/visitor/RollbackVisitor.java @@ -46,7 +46,7 @@ public Direction getDirection() { public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Set filterResults) throws LiquibaseException { Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database); if (! (executor instanceof LoggingExecutor)) { - Scope.getCurrentScope().getUI().sendMessage("Rolling Back Changeset:" + changeSet); + Scope.getCurrentScope().getUI().sendMessage("Rolling Back Changeset: " + changeSet); } sendRollbackWillRunEvent(changeSet, databaseChangeLog, database); try { diff --git a/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java b/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java index 6b0609ff535..7ab6f46e7fc 100644 --- a/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java +++ b/liquibase-core/src/main/java/liquibase/changelog/visitor/UpdateVisitor.java @@ -45,10 +45,10 @@ public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Data Set filterResults) throws LiquibaseException { Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database); if (! (executor instanceof LoggingExecutor)) { - Scope.getCurrentScope().getUI().sendMessage("Running Changeset:" + changeSet); + Scope.getCurrentScope().getUI().sendMessage("Running Changeset: " + changeSet); } ChangeSet.RunStatus runStatus = this.database.getRunStatus(changeSet); - Scope.getCurrentScope().getLog(getClass()).fine("Running Changeset:" + changeSet); + Scope.getCurrentScope().getLog(getClass()).fine("Running Changeset: " + changeSet); fireWillRun(changeSet, databaseChangeLog, database, runStatus); ExecType execType = null; ObjectQuotingStrategy previousStr = this.database.getObjectQuotingStrategy();