commit 8e2af00518088073c60a225f3fd0c8f81cd6950b
Author: pkanavos <pkanavos@gmail.com>
Date:   Thu Oct 4 11:56:32 2012 +0300

    Progress reporting during upload changed to occur every second

diff --git a/trunk/Pithos.Client.WPF/Diagnostics/log4netForwarder.cs b/trunk/Pithos.Client.WPF/Diagnostics/log4netForwarder.cs
index 615116c..fe76c72 100644
--- a/trunk/Pithos.Client.WPF/Diagnostics/log4netForwarder.cs
+++ b/trunk/Pithos.Client.WPF/Diagnostics/log4netForwarder.cs
@@ -1,147 +1,147 @@
-﻿using System;
-using System.Diagnostics;
-using System.Text;
-using System.Threading.Tasks;
-using log4net;
-using log4net.Core;
-
-namespace Pithos.Client.WPF.Diagnostics
-{
-    public class Log4NetForwarder : TraceListener
-    {
-        public override void Write(string message)
-        {
-            WriteLine(message);
-        }
-
-        public override void Write(object o)
-        {
-            WriteLine(o);
-        }
-
-        public override void Write(object o, string category)
-        {
-            WriteLine(o, category);
-        }
-
-        public override void Write(string message, string category)
-        {
-            WriteLine(message, category);
-        }
-
-        public override void WriteLine(string message)
-        {
-            Log(message, Level.Debug);
-        }
-
-
-        public override void WriteLine(object o)
-        {
-            Log(o.ToString(), Level.Debug);
-        }
-
-        public override void WriteLine(object o, string category)
-        {
-            using (ThreadContext.Stacks["Category"].Push(category))
-            {
-                Log(o.ToString(), Level.Debug);
-            }
-        }
-
-        public override void WriteLine(string message, string category)
-        {
-            using (ThreadContext.Stacks["Category"].Push(category))
-            {
-                Log(message, Level.Debug);
-            }
-        }
-
-        public override void Fail(string message)
-        {
-            Log(message, Level.Error);
-        }
-
-        public override void Fail(string message, string detailMessage)
-        {
-            Log(String.Format("{0} {1}", message, detailMessage), Level.Error);
-        }
-
-
-
-        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
-        {
-            var message = String.Format("Event ID: [{0}]", id);
-            Log(source, eventType, message);
-        }
-
-        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
-        {
-            var builder = new StringBuilder();
-            builder.AppendFormat("Event ID: [{0}] ", id);
-            builder.AppendFormat(format, args);
-            var message = builder.ToString();
-
-            Log(source, eventType, message);
-        }
-
-        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
-        {
-            Log(source, eventType, message);
-        }
-
-        private void Log(string source, TraceEventType eventType, string message)
-        {
-            try
-            {
-                var log = LogManager.GetLogger(source);
-                var level = GetLevel(eventType);
-                TaskEx.Run(()=>log.Logger.Log(GetType(), level, message, null));
-            }
-            catch(Exception ex)
-            {
-                
-            }
-        }
-
-        private void Log(string message, Level level)
-        {
-            try
-            {
-
-            var stack = new StackTrace();
-            var type = stack.GetFrame(0).GetMethod().DeclaringType;
-            var log = LogManager.GetLogger(type);
-            log.Logger.Log(GetType(), level, message, null);
-            }
-            catch (Exception)
-            {
-            }
-        }
-
-
-        private static Level GetLevel(TraceEventType eventType)
-        {
-            var level = Level.Debug;
-            switch (eventType)
-            {
-                case TraceEventType.Information:
-                    level = Level.Info;
-                    break;
-                case TraceEventType.Verbose:
-                    level = Level.Verbose;
-                    break;
-                case TraceEventType.Warning:
-                    level = Level.Info;
-                    break;
-                case TraceEventType.Critical:
-                    level = Level.Info;
-                    break;
-                case TraceEventType.Error:
-                    level = Level.Info;
-                    break;
-            }
-            return level;
-        }
-    }
-
-}
+﻿using System;
+using System.Diagnostics;
+using System.Text;
+using System.Threading.Tasks;
+using log4net;
+using log4net.Core;
+
+namespace Pithos.Client.WPF.Diagnostics
+{
+    public class Log4NetForwarder : TraceListener
+    {
+        public override void Write(string message)
+        {
+            WriteLine(message);
+        }
+
+        public override void Write(object o)
+        {
+            WriteLine(o);
+        }
+
+        public override void Write(object o, string category)
+        {
+            WriteLine(o, category);
+        }
+
+        public override void Write(string message, string category)
+        {
+            WriteLine(message, category);
+        }
+
+        public override void WriteLine(string message)
+        {
+            Log(message, Level.Debug);
+        }
+
+
+        public override void WriteLine(object o)
+        {
+            Log(o.ToString(), Level.Debug);
+        }
+
+        public override void WriteLine(object o, string category)
+        {
+            using (ThreadContext.Stacks["Category"].Push(category))
+            {
+                Log(o.ToString(), Level.Debug);
+            }
+        }
+
+        public override void WriteLine(string message, string category)
+        {
+            using (ThreadContext.Stacks["Category"].Push(category))
+            {
+                Log(message, Level.Debug);
+            }
+        }
+
+        public override void Fail(string message)
+        {
+            Log(message, Level.Error);
+        }
+
+        public override void Fail(string message, string detailMessage)
+        {
+            Log(String.Format("{0} {1}", message, detailMessage), Level.Error);
+        }
+
+
+
+        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
+        {
+            var message = String.Format("Event ID: [{0}]", id);
+            Log(source, eventType, message);
+        }
+
+        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
+        {
+            var builder = new StringBuilder();
+            builder.AppendFormat("Event ID: [{0}] ", id);
+            builder.AppendFormat(format, args);
+            var message = builder.ToString();
+
+            Log(source, eventType, message);
+        }
+
+        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
+        {
+            Log(source, eventType, message);
+        }
+
+        private void Log(string source, TraceEventType eventType, string message)
+        {
+            try
+            {
+                var log = LogManager.GetLogger(source);
+                var level = GetLevel(eventType);
+                TaskEx.Run(()=>log.Logger.Log(GetType(), level, message, null));
+            }
+            catch(Exception )
+            {
+                
+            }
+        }
+
+        private void Log(string message, Level level)
+        {
+            try
+            {
+
+            var stack = new StackTrace();
+            var type = stack.GetFrame(0).GetMethod().DeclaringType;
+            var log = LogManager.GetLogger(type);
+            log.Logger.Log(GetType(), level, message, null);
+            }
+            catch (Exception)
+            {
+            }
+        }
+
+
+        private static Level GetLevel(TraceEventType eventType)
+        {
+            var level = Level.Debug;
+            switch (eventType)
+            {
+                case TraceEventType.Information:
+                    level = Level.Info;
+                    break;
+                case TraceEventType.Verbose:
+                    level = Level.Verbose;
+                    break;
+                case TraceEventType.Warning:
+                    level = Level.Info;
+                    break;
+                case TraceEventType.Critical:
+                    level = Level.Info;
+                    break;
+                case TraceEventType.Error:
+                    level = Level.Info;
+                    break;
+            }
+            return level;
+        }
+    }
+
+}
