aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Logging/FileLogger.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-04-15 19:51:07 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-04-15 19:51:07 +0300
commitca293b80c52a54c73251fbf3cd50741fb5653ae9 (patch)
treef1168fa167a26bf8455e601291b8a19945a70187 /Software/Visual_Studio/Tango.Logging/FileLogger.cs
parent9ff8293b603f72c5faa8d238b3005524c31cc5a8 (diff)
downloadTango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.tar.gz
Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.zip
Lots Of Work !
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging/FileLogger.cs')
-rw-r--r--Software/Visual_Studio/Tango.Logging/FileLogger.cs17
1 files changed, 14 insertions, 3 deletions
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,6 +13,10 @@ namespace Tango.Logging
/// <seealso cref="Tango.Logging.ILogger" />
public class FileLogger : ILogger
{
+ /// <summary>
+ /// Gets the logs folder.
+ /// </summary>
+ public static String DefaultLogsFolder { get; private set; }
/// <summary>
/// Gets or sets the log file.
@@ -20,14 +24,21 @@ namespace Tango.Logging
public String LogFile { get; private set; }
/// <summary>
+ /// Initializes the <see cref="FileLogger"/> class.
+ /// </summary>
+ static FileLogger()
+ {
+ DefaultLogsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs");
+ }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="FileLogger"/> class.
/// </summary>
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)));
}
/// <summary>