diff options
author | Alan McGovern <alan@xamarin.com> | 2015-02-05 13:25:55 +0300 |
---|---|---|
committer | Alan McGovern <alan@xamarin.com> | 2015-02-05 13:27:26 +0300 |
commit | 4210cb99d6915dc75a431c0e5907a617437348bc (patch) | |
tree | 0d810ee0b248fd25e971722b60b0827524106a2f /main | |
parent | 09d1d695e623b1d6957367ca9b131af5985a05ea (diff) |
[Core] Always purge logs when the LoggingService initializes
MDTool never calls LoggingService.Initialize. It just uses the
registered-by-default Console logger. As such it never cleared
stale logs *but* it did create them.
One of our build machines had 16,000 log files.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs index 7ef6e407c6..b2c15f9a0e 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs @@ -94,6 +94,11 @@ namespace MonoDevelop.Core LogError ("Error setting custom log file", e); } } + try { + PurgeOldLogs (); + } catch { + LogError ("Could not purge old log files"); + } timestamp = DateTime.Now; @@ -172,8 +177,6 @@ namespace MonoDevelop.Core public static void Initialize (bool redirectOutput) { - PurgeOldLogs (); - // Always redirect on windows otherwise we cannot get output at all if (Platform.IsWindows || redirectOutput) RedirectOutputToLogFile (); |