Clean up migration logging messages

This commit is contained in:
Mark Monteiro 2020-03-08 15:02:59 +01:00
parent a0fdceb4bc
commit 2f0b4cc24c
1 changed files with 5 additions and 4 deletions

View File

@ -46,11 +46,11 @@ namespace Jellyfin.Server.Migrations
var migrationRoutine = Migrations[i]; var migrationRoutine = Migrations[i];
if (applied.Contains(migrationRoutine.Name)) if (applied.Contains(migrationRoutine.Name))
{ {
logger.LogDebug("Skipping migration {Name} as it is already applied", migrationRoutine.Name); logger.LogDebug("Skipping migration '{Name}' since it is already applied", migrationRoutine.Name);
continue; continue;
} }
logger.LogInformation("Applying migration {Name}", migrationRoutine.Name); logger.LogInformation("Applying migration '{Name}'", migrationRoutine.Name);
try try
{ {
@ -58,15 +58,16 @@ namespace Jellyfin.Server.Migrations
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.LogError(ex, "Could not apply migration {Name}", migrationRoutine.Name); logger.LogError(ex, "Could not apply migration '{Name}'", migrationRoutine.Name);
throw; throw;
} }
// Mark the migration as completed // Mark the migration as completed
logger.LogInformation("Migration {Name} applied successfully", migrationRoutine.Name); logger.LogInformation("Migration '{Name}' applied successfully", migrationRoutine.Name);
applied.Add(migrationRoutine.Name); applied.Add(migrationRoutine.Name);
migrationOptions.Applied = applied.ToArray(); migrationOptions.Applied = applied.ToArray();
host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions); host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
logger.LogDebug("Migration '{Name}' marked as applied in configuration.", migrationRoutine.Name);
} }
} }
} }