[Minor] less logging

This commit is contained in:
Robert von Burg 2015-02-11 23:49:25 +01:00
parent b8c07015d1
commit 30d4916a7e
2 changed files with 12 additions and 4 deletions

View File

@ -97,7 +97,8 @@ public class Migrations {
}
if (migrationsRan.isEmpty()) {
logger.info("There were no migrations required!");
if (this.verbose)
logger.info("There were no migrations required!");
} else {
logger.info("Migrated " + migrationsRan.size() + " realms!");
}
@ -144,7 +145,8 @@ public class Migrations {
}
if (migrationsRan.isEmpty()) {
logger.info("There were no migrations required!");
if (this.verbose)
logger.info("There were no migrations required!");
} else {
logger.info("Migrated " + migrationsRan.size() + " realms!");
}

View File

@ -92,6 +92,10 @@ public class MigrationsHandler extends StrolchComponent {
migrations.runCodeMigrations(cert, codeMigrationsByRealm);
}
public boolean isVerbose() {
return this.verbose;
}
@Override
public void initialize(ComponentConfiguration configuration) {
@ -163,7 +167,8 @@ public class MigrationsHandler extends StrolchComponent {
public void run() {
if (!MigrationsHandler.this.migrationsPath.isDirectory()) {
logger.info("There are no migrations required at the moment!");
if (verbose)
logger.info("There are no migrations required at the moment!");
return;
}
@ -179,7 +184,8 @@ public class MigrationsHandler extends StrolchComponent {
MigrationsHandler.this.migrations = migrations;
if (migrations.getMigrationsToRun().isEmpty()) {
logger.info("There are no migrations required at the moment!");
if (verbose)
logger.info("There are no migrations required at the moment!");
} else {
RunMigrationsAction runMigrationsAction = new RunMigrationsAction(MigrationsHandler.this.migrations);
privilegeHandler.runAsSystem(RealmHandler.SYSTEM_USER_AGENT, runMigrationsAction);