[tomboy] Do not use formatting WriteLine overloads unless requested. Prevents
- From: Sanford Armstrong <sharm src gnome org>
- To: svn-commits-list gnome org
- Subject: [tomboy] Do not use formatting WriteLine overloads unless requested. Prevents
- Date: Mon, 29 Jun 2009 15:34:02 +0000 (UTC)
commit b30cac5902d8581884267667643ad946dfa39ecf
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date: Mon Jun 29 08:22:46 2009 -0700
Do not use formatting WriteLine overloads unless requested. Prevents
exceptions when logging strings that happen to contain curly braces.
Tomboy/Logger.cs | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/Tomboy/Logger.cs b/Tomboy/Logger.cs
index c5eef22..54669c8 100644
--- a/Tomboy/Logger.cs
+++ b/Tomboy/Logger.cs
@@ -41,7 +41,10 @@ namespace Tomboy
public void Log (Level lvl, string msg, params object[] args)
{
msg = string.Format ("[{0}]: {1}", Enum.GetName (typeof (Level), lvl), msg);
- Console.WriteLine (msg, args);
+ if (args.Length > 0)
+ Console.WriteLine (msg, args);
+ else
+ Console.WriteLine (msg);
}
}
@@ -95,7 +98,10 @@ namespace Tomboy
DateTime.Now.ToString(),
Enum.GetName (typeof (Level), lvl),
msg);
- log.WriteLine (msg, args);
+ if (args.Length > 0)
+ log.WriteLine (msg, args);
+ else
+ log.WriteLine (msg);
log.Flush();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]