1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +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())) 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) if (stream == null)
{ {
// Only pop up once to prevent spam. Logger.Log($"File {file.Filename} is missing in local storage and will not be included in the export", LoggingTarget.Database);
if (!fileMissing) fileMissing = true;
{ continue;
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);
} }
writer.Write(file.Filename, stream);
} }
if (notification != null) if (notification != null)
@ -77,6 +71,12 @@ namespace osu.Game.Database
i++; 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) catch (ObjectDisposedException)
{ {