diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-01-12 15:56:50 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-01-12 15:56:50 +0200 |
| commit | 9949e351e152a929da696ef2f0a1f8b1668e83fa (patch) | |
| tree | 40212bc488ea64cbaf137455c6a2280333c997dc /Software/Visual_Studio/Tango.Logging/FileLogger.cs | |
| parent | 9016d57f876a70952dda4419d68b568b586ef0ec (diff) | |
| download | Tango-9949e351e152a929da696ef2f0a1f8b1668e83fa.tar.gz Tango-9949e351e152a929da696ef2f0a1f8b1668e83fa.zip | |
Merged Beta+ fixes to master.
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging/FileLogger.cs')
| -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> |
