~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
                }
81
81
 
82
82
                static string GenericLogFile {
83
 
                        get { return "MonoDevelop.log"; }
 
83
                        get { return "Ide.log"; }
84
84
                }
85
85
                
86
86
                public static DateTime LogTimestamp {
89
89
 
90
90
                static string UniqueLogFile {
91
91
                        get {
92
 
                                return string.Format ("MonoDevelop.{0}.log", timestamp.ToString ("yyyy-MM-dd__HH-mm-ss"));
 
92
                                return string.Format ("Ide.{0}.log", timestamp.ToString ("yyyy-MM-dd__HH-mm-ss"));
93
93
                        }
94
94
                }
95
95
                
113
113
                        if (!Directory.Exists (UserProfile.Current.LogDir))
114
114
                                return;
115
115
 
116
 
                        var files = Directory.EnumerateFiles (UserProfile.Current.LogDir)
 
116
                        // HACK: we were using EnumerateFiles but it's broken in some Mono releases
 
117
                        // https://bugzilla.xamarin.com/show_bug.cgi?id=2975
 
118
                        var files = Directory.GetFiles (UserProfile.Current.LogDir)
117
119
                                .Select (f => new FileInfo (f))
118
120
                                .Where (f => f.CreationTimeUtc < DateTime.UtcNow.Subtract (TimeSpan.FromDays (7)));
119
121
 
323
325
                
324
326
                public static void LogDebug (string message, Exception ex)
325
327
                {
326
 
                        Log (LogLevel.Debug, message + System.Environment.NewLine + (ex != null? ex.ToString () : string.Empty));
 
328
                        Log (LogLevel.Debug, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
327
329
                }
328
330
                
329
331
                public static void LogInfo (string message, Exception ex)
330
332
                {
331
 
                        Log (LogLevel.Info, message + System.Environment.NewLine + (ex != null? ex.ToString () : string.Empty));
 
333
                        Log (LogLevel.Info, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
332
334
                }
333
335
                
334
336
                public static void LogWarning (string message, Exception ex)
335
337
                {
336
 
                        Log (LogLevel.Warn, message + System.Environment.NewLine + (ex != null? ex.ToString () : string.Empty));
 
338
                        Log (LogLevel.Warn, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
337
339
                }
338
340
                
339
341
                public static void LogError (string message, Exception ex)
340
342
                {
341
 
                        Log (LogLevel.Error, message + System.Environment.NewLine + (ex != null? ex.ToString () : string.Empty));
 
343
                        Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
342
344
                }
343
345
                
344
346
                public static void LogFatalError (string message, Exception ex)
345
347
                {
346
 
                        Log (LogLevel.Fatal, message + System.Environment.NewLine + (ex != null? ex.ToString () : string.Empty));
 
348
                        Log (LogLevel.Fatal, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
347
349
                }
348
 
                
 
350
 
349
351
#endregion
350
352
        }
351
353
}