comparison mde/setup/Init.d @ 153:2934fcacbb97

Fixed a bug preventing log messages from being displayed. Added a Help->About menu (logs copyright info).
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 10 Apr 2009 18:09:55 +0200
parents e785e98d3b78
children e45226d3deae
comparison
equal deleted inserted replaced
152:c67d074a7111 153:2934fcacbb97
168 root.append (Level.None, ""); // some kind of separation between runs 168 root.append (Level.None, ""); // some kind of separation between runs
169 root.append (Level.None, ""); 169 root.append (Level.None, "");
170 } 170 }
171 if (!(logOutput() & 1)) 171 if (!(logOutput() & 1))
172 root.add(new AppendConsole); 172 root.add(new AppendConsole);
173 logger.info ("Starting mde [no version] on " ~ TimeStamp.toString(WallClock.now));
174 } catch (Exception e) { 173 } catch (Exception e) {
175 // Presumably it was only adding a file appender which failed; set up a new console 174 // Presumably it was only adding a file appender which failed; set up a new console
176 // logger and if that fails let the exception kill the program. 175 // logger and if that fails let the exception kill the program.
177 root.clear; 176 root.clear;
178 root.add (new AppendConsole); 177 root.add (new AppendConsole);
179 logger.error ("Exception while setting up the logger; logging to the console instead."); 178 logger.error ("Exception while setting up the logger; logging to the console instead.");
180 } 179 }
181 180
181 // Done enough init to know where and when to log messages now
182 logger.info ("Starting mde [no version] on " ~ TimeStamp.toString(WallClock.now));
183
182 // a debugging option: 184 // a debugging option:
183 imde.run = imde.run && !exitImmediately(); 185 imde.run = imde.run && !exitImmediately();
184 debug logger.trace ("Init: applied pre-init options"); 186 debug logger.trace ("Init: applied pre-init options");
185 187
186 //BEGIN Load dynamic libraries 188 //BEGIN Load dynamic libraries
409 } 411 }
410 debug { 412 debug {
411 Log.root.level (Level.Trace); 413 Log.root.level (Level.Trace);
412 logger.trace ("Setting logging level {}", logLevel()); 414 logger.trace ("Setting logging level {}", logLevel());
413 } 415 }
414 Log.root.level (logOutput() == 0 ? Level.None : cast(Level) logLevel(), true); 416 Log.root.level (logOutput() == 3 ? Level.None : cast(Level) logLevel(), true);
415 } 417 }
416 418
417 void printUsage (char[] progName) { 419 void printUsage (char[] progName) {
418 Cout ("mde [no version]").newline; 420 Cout ("mde [no version]").newline;
419 Cout ("Usage:").newline; 421 Cout ("Usage:").newline;