mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-25 20:16:06 +01:00
fix: Clean up config migration logging
This commit is contained in:
parent
433160f187
commit
136bd3cbe2
@ -23,9 +23,8 @@ public class ConfigMigrator {
|
|||||||
public void migrate(MVSettings settings) {
|
public void migrate(MVSettings settings) {
|
||||||
double versionNumber = settings.get(versionNode);
|
double versionNumber = settings.get(versionNode);
|
||||||
for (VersionMigrator versionMigrator : versionMigrators) {
|
for (VersionMigrator versionMigrator : versionMigrators) {
|
||||||
Logging.info("Checking if config needs to be migrated from version " + versionNumber + " to " + versionMigrator.getVersion());
|
|
||||||
if (versionNumber < versionMigrator.getVersion()) {
|
if (versionNumber < versionMigrator.getVersion()) {
|
||||||
Logging.info("Migrating config from version " + versionNumber + " to " + versionMigrator.getVersion());
|
Logging.config("Migrating config from version %s to %s...", versionNumber, versionMigrator.getVersion());
|
||||||
versionMigrator.migrate(settings);
|
versionMigrator.migrate(settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,12 +20,11 @@ public class MoveMigratorAction implements MigratorAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void migrate(MVSettings settings) {
|
public void migrate(MVSettings settings) {
|
||||||
Logging.info(String.valueOf(settings.getConfig().get(fromPath)));
|
|
||||||
Optional.ofNullable(settings.getConfig().get(fromPath))
|
Optional.ofNullable(settings.getConfig().get(fromPath))
|
||||||
.ifPresent(value -> {
|
.ifPresent(value -> {
|
||||||
Logging.info("Moving " + fromPath + " to " + toPath);
|
|
||||||
settings.getConfig().set(toPath, value);
|
settings.getConfig().set(toPath, value);
|
||||||
settings.getConfig().set(fromPath, null);
|
settings.getConfig().set(fromPath, null);
|
||||||
|
Logging.config("Moved path %s to %s", fromPath, toPath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user