diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging')
| -rw-r--r-- | Software/Visual_Studio/Tango.Logging/FileLogger.cs | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Software/Visual_Studio/Tango.Logging/FileLogger.cs b/Software/Visual_Studio/Tango.Logging/FileLogger.cs index 3b911b4d4..0839a5ee7 100644 --- a/Software/Visual_Studio/Tango.Logging/FileLogger.cs +++ b/Software/Visual_Studio/Tango.Logging/FileLogger.cs @@ -98,12 +98,14 @@ namespace Tango.Logging /// <summary> /// Initializes a new instance of the <see cref="FileLogger"/> class. /// </summary> - public FileLogger() + /// <param name="folder">Logs folder path.</param> + /// <param name="tag">The tag name which will be appended to the file name.</param> + public FileLogger(String folder, String tag) { _isEnabled = true; - Tag = Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName); - Folder = DefaultLogsFolder; + Tag = tag; + Folder = folder; Directory.CreateDirectory(Folder); _logFileTimeDate = DateTime.Now; LogFile = CreateLogFileName(); @@ -117,22 +119,17 @@ namespace Tango.Logging _removal_timer.Elapsed += _removal_timer_Elapsed; _removal_timer.Start(); - EnableMaxFileSizeLimit = false; - MaxFileSizeLimit = 1000000 * 10; //10 MB + EnableMaxFileSizeLimit = true; + MaxFileSizeLimit = 1000000 * 10; + _fileExtensionIndex = 0; } /// <summary> /// Initializes a new instance of the <see cref="FileLogger"/> class. /// </summary> - /// <param name="folder">Logs folder path.</param> - /// <param name="tag">The tag name which will be appended to the file name.</param> - public FileLogger(String folder, String tag) - : this() + public FileLogger() : this(DefaultLogsFolder, Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName)) { - Folder = folder; - Tag = tag; - Directory.CreateDirectory(Folder); - LogFile = CreateLogFileName(); + } /// <summary> |
