diff --git a/Vocaluxe/Base/CLog.cs b/Vocaluxe/Base/CLog.cs index 2dd153f0..740d958e 100644 --- a/Vocaluxe/Base/CLog.cs +++ b/Vocaluxe/Base/CLog.cs @@ -28,7 +28,7 @@ namespace Vocaluxe.Base private readonly string _LogFileName; private readonly string _LogName; private StreamWriter _LogFile; - private Object _FileMutex = new Object(); + private readonly Object _FileMutex = new Object(); public CLogFile(string fileName, string logName) { @@ -94,6 +94,8 @@ namespace Vocaluxe.Base private static CLogFile _ErrorLog; private static CLogFile _PerformanceLog; private static CLogFile _BenchmarkLog; + private static CLogFile _DebugLog; + private static CLogFile _SongInfoLog; private static int _NumErrors; private static Stopwatch[] _BenchmarkTimer; @@ -101,9 +103,11 @@ namespace Vocaluxe.Base public static void Init() { - _ErrorLog = new CLogFile(CSettings.FileErrorLog, "ErrorLog"); - _PerformanceLog = new CLogFile(CSettings.FilePerformanceLog, "PerformanceLog"); - _BenchmarkLog = new CLogFile(CSettings.FileBenchmarkLog, "BenchmarkLog"); + _ErrorLog = new CLogFile(CSettings.FileErrorLog, "Error-Log"); + _PerformanceLog = new CLogFile(CSettings.FilePerformanceLog, "Performance-Log"); + _BenchmarkLog = new CLogFile(CSettings.FileBenchmarkLog, "Benchmark-Log"); + _DebugLog = new CLogFile(CSettings.FileDebugLog, "Debug-Log"); + _SongInfoLog = new CLogFile(CSettings.FileSongInfoLog, "Song-Information-Log"); _NumErrors = 0; _BenchmarkTimer = new Stopwatch[_MaxBenchmarks]; @@ -116,6 +120,8 @@ namespace Vocaluxe.Base _ErrorLog.Close(); _PerformanceLog.Close(); _BenchmarkLog.Close(); + _DebugLog.Close(); + _SongInfoLog.Close(); } #region LogError @@ -132,6 +138,16 @@ namespace Vocaluxe.Base } #endregion LogError + public static void LogDebug(string text) + { + _DebugLog.Add(String.Format("{0:HH:mm:ss.ffff}", DateTime.Now) + ":" + text); + } + + public static void LogSongInfo(string text) + { + _SongInfoLog.Add(text); + } + #region LogPerformance public static void LogPerformance(string text) { diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index fad6fe07..e0f02c3d 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -443,6 +443,16 @@ namespace Vocaluxe.Base { CLog.LogError(errorText); } + + public void LogDebug(string text) + { + CLog.LogDebug(text); + } + + public void LogSongInfo(string text) + { + CLog.LogSongInfo(text); + } } class CBfonts : IFonts diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index e70a0d0c..e9dd805d 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -85,6 +85,8 @@ namespace Vocaluxe.Base public const string FilePerformanceLog = "Performance.log"; public const string FileErrorLog = "Error.log"; public const string FileBenchmarkLog = "Benchmark.log"; + public const string FileDebugLog = "Debug.log"; + public const string FileSongInfoLog = "SongInformation.log"; public const string SoundT440 = "440Hz.mp3"; diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs index 682597b4..334221a0 100644 --- a/VocaluxeLib/IBasic.cs +++ b/VocaluxeLib/IBasic.cs @@ -155,6 +155,8 @@ namespace VocaluxeLib public interface ILog { void LogError(string errorText); + void LogDebug(string text); + void LogSongInfo(string text); } public interface IFonts diff --git a/VocaluxeLib/Songs/CSongLoader.cs b/VocaluxeLib/Songs/CSongLoader.cs index 98ba075c..8c959583 100644 --- a/VocaluxeLib/Songs/CSongLoader.cs +++ b/VocaluxeLib/Songs/CSongLoader.cs @@ -81,7 +81,7 @@ namespace VocaluxeLib.Songs msg = (error ? "Error: " : "Warning: ") + msg; if (withLineNr) msg += " in line #" + _LineNr; - CBase.Log.LogError(msg + " (" + Path.Combine(_Song.Folder, _Song.FileName) + ")"); + CBase.Log.LogSongInfo(msg + " (" + Path.Combine(_Song.Folder, _Song.FileName) + ")"); } private void _LogError(string msg, bool withLineNr = true)