From c1dd8d659efb0ee8321768ea31460e9dfa223958 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 8 Aug 2014 20:57:09 +0900 Subject: [PATCH] Refactored Logger.cs --- websocket-sharp/Logger.cs | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/websocket-sharp/Logger.cs b/websocket-sharp/Logger.cs index dd98e880..c5325785 100644 --- a/websocket-sharp/Logger.cs +++ b/websocket-sharp/Logger.cs @@ -46,7 +46,7 @@ namespace WebSocketSharp /// /// /// If you would like to use the custom output action, you should set the - /// to any Action<LogData, string>. + /// to any Action<LogData, string> delegate. /// /// public class Logger @@ -114,10 +114,10 @@ namespace WebSocketSharp #region Public Properties /// - /// Gets or sets the path to the log file. + /// Gets or sets the current path to the log file. /// /// - /// A that represents the path to the log file if any. + /// A that represents the current path to the log file if any. /// public string File { get { @@ -191,7 +191,7 @@ namespace WebSocketSharp var log = data.ToString (); Console.WriteLine (log); if (path != null && path.Length > 0) - writeToFile (path, log); + writeToFile (log, path); } private void output (string message, LogLevel level) @@ -212,12 +212,11 @@ namespace WebSocketSharp } } - private static void writeToFile (string path, string value) + private static void writeToFile (string value, string path) { using (var writer = new StreamWriter (path, true)) - using (var syncWriter = TextWriter.Synchronized (writer)) { + using (var syncWriter = TextWriter.Synchronized (writer)) syncWriter.WriteLine (value); - } } #endregion @@ -228,8 +227,8 @@ namespace WebSocketSharp /// Outputs as a log with . /// /// - /// If the current logging level is higher than , this method - /// doesn't output as a log. + /// If the current logging level is higher than , + /// this method doesn't output as a log. /// /// /// A that represents the message to output as a log. @@ -246,8 +245,8 @@ namespace WebSocketSharp /// Outputs as a log with . /// /// - /// If the current logging level is higher than , this method - /// doesn't output as a log. + /// If the current logging level is higher than , + /// this method doesn't output as a log. /// /// /// A that represents the message to output as a log. @@ -275,8 +274,8 @@ namespace WebSocketSharp /// Outputs as a log with . /// /// - /// If the current logging level is higher than , this method - /// doesn't output as a log. + /// If the current logging level is higher than , + /// this method doesn't output as a log. /// /// /// A that represents the message to output as a log. @@ -293,8 +292,8 @@ namespace WebSocketSharp /// Outputs as a log with . /// /// - /// If the current logging level is higher than , this method - /// doesn't output as a log. + /// If the current logging level is higher than , + /// this method doesn't output as a log. /// /// /// A that represents the message to output as a log. @@ -311,8 +310,8 @@ namespace WebSocketSharp /// Outputs as a log with . /// /// - /// If the current logging level is higher than , this method - /// doesn't output as a log. + /// If the current logging level is higher than , + /// this method doesn't output as a log. /// /// /// A that represents the message to output as a log.