X-Git-Url: https://code.grnet.gr/git/pithos-ms-client/blobdiff_plain/79f92570abeab92028ac53b2541c295a61c258a5..049333d29587d9d92865bc2867424010b7f15585:/trunk/NetSparkle/NetSparkleMainWindows.cs diff --git a/trunk/NetSparkle/NetSparkleMainWindows.cs b/trunk/NetSparkle/NetSparkleMainWindows.cs index d8c2a57..92a3a09 100644 --- a/trunk/NetSparkle/NetSparkleMainWindows.cs +++ b/trunk/NetSparkle/NetSparkleMainWindows.cs @@ -4,23 +4,23 @@ using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; +using System.Reflection; using System.Text; using System.Windows.Forms; using System.IO; +using log4net; namespace AppLimit.NetSparkle { public partial class NetSparkleMainWindows : Form, IDisposable { - private StreamWriter sw = null; + private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public NetSparkleMainWindows() { // init ui InitializeComponent(); - // init logfile - sw = File.CreateText(Path.Combine(Environment.ExpandEnvironmentVariables("%temp%"), "NetSparkle.log")); } public void Report(String message) @@ -45,11 +45,7 @@ namespace AppLimit.NetSparkle { try { - // write - sw.WriteLine(msg); - - // flush - sw.Flush(); + Log.Info(msg); } catch(Exception) { @@ -60,11 +56,6 @@ namespace AppLimit.NetSparkle void IDisposable.Dispose() { - // flush again - sw.Flush(); - - // close the stream - sw.Dispose(); // close the base base.Dispose();