From ca293b80c52a54c73251fbf3cd50741fb5653ae9 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 15 Apr 2018 19:51:07 +0300 Subject: Lots Of Work ! --- Software/Visual_Studio/Tango.Logging/FileLogger.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/Tango.Logging/FileLogger.cs') diff --git a/Software/Visual_Studio/Tango.Logging/FileLogger.cs b/Software/Visual_Studio/Tango.Logging/FileLogger.cs index e104b59b9..215b1d9ac 100644 --- a/Software/Visual_Studio/Tango.Logging/FileLogger.cs +++ b/Software/Visual_Studio/Tango.Logging/FileLogger.cs @@ -13,21 +13,32 @@ namespace Tango.Logging /// public class FileLogger : ILogger { + /// + /// Gets the logs folder. + /// + public static String DefaultLogsFolder { get; private set; } /// /// Gets or sets the log file. /// public String LogFile { get; private set; } + /// + /// Initializes the class. + /// + static FileLogger() + { + DefaultLogsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs"); + } + /// /// Initializes a new instance of the class. /// public FileLogger() { _isEnabled = true; - String logsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs"); - Directory.CreateDirectory(logsFolder); - LogFile = Path.Combine(logsFolder, string.Format("{1}-{0:dd-MM-yyyy_hh-mm-ss}.log", DateTime.Now, Path.GetFileNameWithoutExtension(System.AppDomain.CurrentDomain.FriendlyName))); + Directory.CreateDirectory(DefaultLogsFolder); + LogFile = Path.Combine(DefaultLogsFolder, string.Format("{1}-{0:dd-MM-yyyy_HH-mm-ss}.log", DateTime.Now, Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName))); } /// -- cgit v1.3.1