- Timestamp:
- 07/24/11 22:34:29 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Console.h
r11053 r11580 12 12 public: 13 13 ConsoleStream(const char *name); 14 15 void SetNullOutput(bool null) { fLogO.SetNullOutput(null); } 14 16 15 17 // I/O -
trunk/FACT++/src/LocalControl.h
r11479 r11580 154 154 { 155 155 public: 156 LocalStream(const char *name, bool = false)157 : LocalControl<ConsoleStream>(name) { }156 LocalStream(const char *name, bool null = false) 157 : LocalControl<ConsoleStream>(name) { SetNullOutput(null); } 158 158 }; 159 159 -
trunk/FACT++/src/Main.h
r11577 r11580 20 20 ("host", var<string>(""), "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)") 21 21 ("log,l", var<string>(n), "Write log-file") 22 ("null", po_switch(), "Suppresses almost all console output - including errors (only available without --console option)") 22 23 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)") 23 24 ("cmd", vars<string>(), "Execute one or more commands at startup") … … 47 48 // ----------------------------------------------------------------- 48 49 50 cout << conf.Has("console") << endl; 51 cout << conf.Has("null") << endl; 49 52 static T shell(conf.GetName().c_str(), 50 conf.Has("console") ? conf.Get<int>("console")!=1 : 0);53 conf.Has("console") ? conf.Get<int>("console")!=1 : conf.Get<bool>("null")); 51 54 52 55 WindowLog &win = shell.GetStreamIn(); 53 56 WindowLog &wout = shell.GetStreamOut(); 54 57 58 // Switching off buffering is not strictly necessary, since 59 // the destructor of shell should flush everything still buffered, 60 // nevertheless it helps to debug problems in the initialization 61 // sequence. 55 62 const bool backlog = wout.GetBacklog(); 56 63 const bool null = wout.GetNullOutput(); 57 wout.SetBacklog(false); 58 wout.SetNullOutput(false); 59 wout.Display(true); 64 if (conf.Has("console") || !conf.Get<bool>("null")) 65 { 66 wout.SetBacklog(false); 67 wout.SetNullOutput(false); 68 wout.Display(true); 69 } 60 70 61 71 if (conf.Has("log")) … … 116 126 io_service.Message("==================== Starting main loop ================="); 117 127 118 wout.SetNullOutput(null); 119 wout.SetBacklog(backlog); 128 if (conf.Has("console") || !conf.Get<bool>("null")) 129 { 130 wout.SetNullOutput(null); 131 wout.SetBacklog(backlog); 132 } 120 133 121 134 shell.SetReceiver(io_service);
Note:
See TracChangeset
for help on using the changeset viewer.