1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Move file missing logging to a better location, and log actual filenames to logs

This commit is contained in:
Dean Herbert 2023-05-05 16:50:05 +09:00
parent 4ec98b0578
commit 9cafb20fcb

View File

@ -54,20 +54,14 @@ namespace osu.Game.Database
using (var stream = UserFileStorage.GetStream(file.File.GetStoragePath()))
{
// Sometimes we cannot find the file(probably deleted by the user), so we handle this and post a error.
if (stream == null)
{
// Only pop up once to prevent spam.
if (!fileMissing)
{
Logger.Log("Some of model files are missing, they will not be included in the archive", LoggingTarget.Database, LogLevel.Error);
fileMissing = true;
}
}
else
{
writer.Write(file.Filename, stream);
Logger.Log($"File {file.Filename} is missing in local storage and will not be included in the export", LoggingTarget.Database);
fileMissing = true;
continue;
}
writer.Write(file.Filename, stream);
}
if (notification != null)
@ -77,6 +71,12 @@ namespace osu.Game.Database
i++;
}
// Only pop up once to prevent spam.
if (fileMissing)
{
Logger.Log("Some of model files are missing, they will not be included in the archive", LoggingTarget.Database, LogLevel.Error);
}
}
catch (ObjectDisposedException)
{