1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00

Fix storage wrapping logic setting logger too early in startup sequence

This commit is contained in:
Dean Herbert 2021-07-09 13:17:25 +09:00
parent dbfeea9880
commit f3b68a4fbf

View File

@ -102,8 +102,15 @@ namespace osu.Game.IO
protected override void ChangeTargetStorage(Storage newStorage)
{
var lastStorage = UnderlyingStorage;
base.ChangeTargetStorage(newStorage);
Logger.Storage = UnderlyingStorage.GetStorageForDirectory("logs");
if (lastStorage != null)
{
// for now we assume that if there was a previous storage, this is a migration operation.
// the logger shouldn't be set during initialisation as it can cause cross-talk in tests (due to being static).
Logger.Storage = UnderlyingStorage.GetStorageForDirectory("logs");
}
}
public override void Migrate(Storage newStorage)