1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 10:17:19 +08:00

Redirect log output to custom data directory

This commit is contained in:
Dean Herbert 2020-05-04 17:35:35 +09:00
parent 6621d363da
commit 5edabbdee2

View File

@ -71,6 +71,8 @@ namespace osu.Game
protected MenuCursorContainer MenuCursorContainer; protected MenuCursorContainer MenuCursorContainer;
protected StorageConfigManager StorageConfig;
private Container content; private Container content;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
@ -302,13 +304,17 @@ namespace osu.Game
{ {
base.SetHost(host); base.SetHost(host);
var storageConfig = new StorageConfigManager(host.Storage); StorageConfig = new StorageConfigManager(host.Storage);
var customStoragePath = storageConfig.Get<string>(StorageConfig.FullPath); var customStoragePath = StorageConfig.Get<string>(Configuration.StorageConfig.FullPath);
Storage = !string.IsNullOrEmpty(customStoragePath) if (!string.IsNullOrEmpty(customStoragePath))
? new CustomStorage(customStoragePath, host) {
: host.Storage; Storage = new CustomStorage(customStoragePath, host);
Logger.Storage = Storage.GetStorageForDirectory("logs");
}
else
Storage = host.Storage;
if (LocalConfig == null) if (LocalConfig == null)
LocalConfig = new OsuConfigManager(Storage); LocalConfig = new OsuConfigManager(Storage);