Fix OpenRA.Lint throwing because "perf" log channel does not exist
Slightly modified the Log class to allow dummy channels that don't write anywhere, then use it on Lint because map loading writes to the "perf" channel.
This commit is contained in:
@@ -46,6 +46,12 @@ namespace OpenRA
|
||||
{
|
||||
if (Channels.ContainsKey(channelName)) return;
|
||||
|
||||
if (string.IsNullOrEmpty(baseFilename))
|
||||
{
|
||||
Channels.Add(channelName, new ChannelInfo());
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var filename in FilenamesForChannel(channelName, baseFilename))
|
||||
try
|
||||
{
|
||||
@@ -70,6 +76,9 @@ namespace OpenRA
|
||||
if (!Channels.TryGetValue(channel, out info))
|
||||
throw new Exception("Tried logging to non-existant channel " + channel);
|
||||
|
||||
if (info.Writer == null)
|
||||
return;
|
||||
|
||||
info.Writer.WriteLine(format, args);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user