Skip to content

Commit

Permalink
Merge pull request #19096 from peppy/custom-storage-log-output
Browse files Browse the repository at this point in the history
Add log output for custom storage usage
  • Loading branch information
smoogipoo authored Jul 13, 2022
2 parents b6528b9 + 27ef7fc commit 7f59426
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions osu.Game/IO/OsuStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public bool TryChangeToCustomStorage(out OsuStorageError error)
error = OsuStorageError.None;
Storage lastStorage = UnderlyingStorage;

Logger.Log($"Attempting to use custom storage location {CustomStoragePath}");

try
{
Storage userStorage = host.GetStorage(CustomStoragePath);
Expand All @@ -102,13 +104,17 @@ public bool TryChangeToCustomStorage(out OsuStorageError error)
error = OsuStorageError.AccessibleButEmpty;

ChangeTargetStorage(userStorage);
Logger.Log($"Storage successfully changed to {CustomStoragePath}.");
}
catch
{
error = OsuStorageError.NotAccessible;
ChangeTargetStorage(lastStorage);
}

if (error != OsuStorageError.None)
Logger.Log($"Custom storage location could not be used ({error}).");

return error == OsuStorageError.None;
}

Expand Down

0 comments on commit 7f59426

Please sign in to comment.