Prevent the creation of Logfiles in the Game Directory
This commit is contained in:
@@ -180,7 +180,6 @@ namespace OpenRA
|
||||
|
||||
Settings = new Settings(Platform.ResolvePath("^", "settings.yaml"), args);
|
||||
|
||||
Log.LogPath = Platform.ResolvePath("^", "Logs");
|
||||
Log.AddChannel("perf", "perf.log");
|
||||
Log.AddChannel("debug", "debug.log");
|
||||
Log.AddChannel("sync", "syncreport.log");
|
||||
|
||||
@@ -22,24 +22,15 @@ namespace OpenRA
|
||||
|
||||
public static class Log
|
||||
{
|
||||
static string LogPathPrefix = ".";
|
||||
public static readonly Dictionary<string, ChannelInfo> Channels = new Dictionary<string, ChannelInfo>();
|
||||
|
||||
public static string LogPath
|
||||
{
|
||||
get { return LogPathPrefix; }
|
||||
set
|
||||
{
|
||||
LogPathPrefix = value;
|
||||
Directory.CreateDirectory(LogPathPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
static IEnumerable<string> FilenamesForChannel(string channelName, string baseFilename)
|
||||
{
|
||||
var path = Platform.SupportDir + "Logs";
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
for(var i = 0;; i++ )
|
||||
yield return Path.Combine(LogPathPrefix,
|
||||
i > 0 ? "{0}.{1}".F(baseFilename, i) : baseFilename);
|
||||
yield return Path.Combine(path, i > 0 ? "{0}.{1}".F(baseFilename, i) : baseFilename);
|
||||
}
|
||||
|
||||
public static void AddChannel(string channelName, string baseFilename)
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace OpenRA.Utility
|
||||
|
||||
AppDomain.CurrentDomain.AssemblyResolve += GlobalFileSystem.ResolveAssembly;
|
||||
|
||||
Log.LogPath = Platform.ResolvePath("^", "Logs");
|
||||
Log.AddChannel("perf", null);
|
||||
Log.AddChannel("debug", null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user