Skip to content

Commit

Permalink
Add log output for custom storage usage
Browse files Browse the repository at this point in the history
Sometimes I am not sure where my osu! is reading files from. This should
help somewhat.

```csharp
/Users/dean/Projects/osu/osu.Desktop/bin/Debug/net6.0/osu!
[runtime] 2022-07-13 07:22:03 [verbose]: Starting legacy IPC provider...
[runtime] 2022-07-13 07:22:03 [verbose]: Attempting to use custom storage location /Users/dean/Games/osu-lazer-2
[runtime] 2022-07-13 07:22:03 [verbose]: Storage successfully changed to /Users/dean/Games/osu-lazer-2.
[runtime] 2022-07-13 07:22:05 [verbose]: GL Initialized
```
  • Loading branch information
peppy committed Jul 13, 2022
1 parent 83703e2 commit 27ef7fc
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 27ef7fc

Please sign in to comment.