Log logging init errors to console if DEBUG flag is present.

This commit is contained in:
lukeIam committed 2018-01-24 18:06:13 +01:00
1 parent 6c4a710b81
commit 5b3e13f373
1 file changed
+12 -3
+12 -3
View File
@@ -42,9 +42,12 @@ namespace VocaluxeLib.Log.Rolling
{ {
File.Move(currentSourceFile, currentTargetFile); File.Move(currentSourceFile, currentTargetFile);
} }
catch (Exception) catch (Exception e)
{ {
// Cant log anything here as the log isn't initialized yet // Cant log anything here as the log isn't initialized yet
#if DEBUG
Console.WriteLine($"Error moving old log file: {e.Message}");
#endif
} }
} }
} }
@@ -58,9 +61,12 @@ namespace VocaluxeLib.Log.Rolling
else else
File.Delete(mainLogFile); File.Delete(mainLogFile);
} }
catch (Exception) catch (Exception e)
{ {
// Cant log anything here as the log isn't initialized yet // Cant log anything here as the log isn't initialized yet
#if DEBUG
Console.WriteLine($"Error moving old main log file: {e.Message}");
#endif
} }
} }
} }
@@ -83,9 +89,12 @@ namespace VocaluxeLib.Log.Rolling
{ {
File.Delete(file); File.Delete(file);
} }
catch (Exception) catch (Exception e)
{ {
// Cant log anything here as the log isn't initialized yet // Cant log anything here as the log isn't initialized yet
#if DEBUG
Console.WriteLine($"Error deleting old log file: {e.Message}");
#endif
} }
} }