From 2df76ad962bae44c2d5fec47d117f5ea40b79dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 16 Aug 2015 14:55:43 +0200 Subject: [PATCH] add an overload that doesn't use string.Format --- OpenRA.Game/Support/Log.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OpenRA.Game/Support/Log.cs b/OpenRA.Game/Support/Log.cs index f839cf249d..a20143d668 100644 --- a/OpenRA.Game/Support/Log.cs +++ b/OpenRA.Game/Support/Log.cs @@ -61,6 +61,18 @@ namespace OpenRA catch (IOException) { } } + public static void Write(string channel, string value) + { + ChannelInfo info; + if (!Channels.TryGetValue(channel, out info)) + throw new Exception("Tried logging to non-existant channel " + channel); + + if (info.Writer == null) + return; + + info.Writer.WriteLine(value); + } + public static void Write(string channel, string format, params object[] args) { ChannelInfo info;