~ubuntu-branches/ubuntu/saucy/monodevelop/saucy-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: 2012-06-22 20:35:35 UTC
  • mfrom: (10.3.2)
  • Revision ID: package-import@ubuntu.com-20120622203535-zrozwvcf6kfk6l6i
Tags: 3.0.3.2+dfsg-1
* [3fd89ae] Imported Upstream version 3.0.3.2+dfsg
* [379a680] Remove old patches we haven't used for ages from git.
* [d71161d] Remove correct_paths_in_monodevelop-core-addins.pc.patch.
  Upstream claim to have fixed this by moving assembly install locations.
* [15dbfb9] Fix install location for MonoDevelop.Gettext.dll.config.
* [26eb434] Fix install location for MonoDevelop.SourceEditor2.dll.config.
* [4169974] Upstream commit 53282c9 which finally reconciles the 
  MonoDevelop.Gettext.dll install location with the 
  monodevelop-core-addins.pc location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
                static List<ILogger> loggers = new List<ILogger> ();
42
42
                static RemoteLogger remoteLogger;
43
43
                static DateTime timestamp;
44
 
                
 
44
                static TextWriter defaultError;
 
45
                static TextWriter defaultOut;
 
46
 
45
47
                static LoggingService ()
46
48
                {
47
49
                        ConsoleLogger consoleLogger = new ConsoleLogger ();
100
102
                                RedirectOutputToLogFile ();
101
103
                }
102
104
                
 
105
                public static void Shutdown ()
 
106
                {
 
107
                        RestoreOutputRedirection ();
 
108
                }
 
109
 
103
110
                static void PurgeOldLogs ()
104
111
                {
105
112
                        // Delete all logs older than a week
118
125
                                }
119
126
                        }
120
127
                }
121
 
                
 
128
 
122
129
                static void RedirectOutputToLogFile ()
123
130
                {
124
131
                        FilePath logDir = UserProfile.Current.LogDir;
145
152
                        var stderr = new MonoDevelop.Core.ProgressMonitoring.LogTextWriter ();
146
153
                        stderr.ChainWriter (Console.Error);
147
154
                        stderr.ChainWriter (writer);
 
155
                        defaultError = Console.Error;
148
156
                        Console.SetError (stderr);
149
157
 
150
158
                        var stdout = new MonoDevelop.Core.ProgressMonitoring.LogTextWriter ();
151
159
                        stdout.ChainWriter (Console.Out);
152
160
                        stdout.ChainWriter (writer);
 
161
                        defaultOut = Console.Out;
153
162
                        Console.SetOut (stdout);
154
163
                }
155
164
                
187
196
                                Mono.Unix.Native.Syscall.close (fd);
188
197
                        }
189
198
                }
 
199
 
 
200
                static void RestoreOutputRedirection ()
 
201
                {
 
202
                        if (defaultError != null)
 
203
                                Console.SetError (defaultError);
 
204
                        if (defaultOut != null)
 
205
                                Console.SetOut (defaultOut);
 
206
                }
190
207
                
191
208
                internal static RemoteLogger RemoteLogger {
192
209
                        get {