From 5b3e13f373033fa0fbc97027d3901892dc23bab1 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Wed, 24 Jan 2018 18:06:13 +0100 Subject: [PATCH] Log logging init errors to console if DEBUG flag is present. --- VocaluxeLib/Log/Rolling/CLogFileRoller.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/VocaluxeLib/Log/Rolling/CLogFileRoller.cs b/VocaluxeLib/Log/Rolling/CLogFileRoller.cs index 82eb2340..89c466a4 100644 --- a/VocaluxeLib/Log/Rolling/CLogFileRoller.cs +++ b/VocaluxeLib/Log/Rolling/CLogFileRoller.cs @@ -42,9 +42,12 @@ namespace VocaluxeLib.Log.Rolling { File.Move(currentSourceFile, currentTargetFile); } - catch (Exception) + catch (Exception e) { // 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 File.Delete(mainLogFile); } - catch (Exception) + catch (Exception e) { // 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); } - catch (Exception) + catch (Exception e) { // Cant log anything here as the log isn't initialized yet +#if DEBUG + Console.WriteLine($"Error deleting old log file: {e.Message}"); +#endif } }