Changeset 10707 for trunk/FACT++/src/dataLogger.cc
- Timestamp:
- 05/13/11 15:48:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dataLogger.cc
r10693 r10707 318 318 public: 319 319 // void setBlackWhiteList(const std::string& , bool); 320 void Setup(Configuration& conf);320 bool SetConfiguration(Configuration& conf); 321 321 322 322 private: … … 681 681 682 682 //services parameters 683 fDebugIsOn = true;//false;683 fDebugIsOn = false; 684 684 fStatsPeriodDuration = 1.0f; 685 685 fOpenedFilesIsOn = true; … … 1269 1269 Message("Run Path: " + actualTargetDir); 1270 1270 stringstream str; 1271 str << "Run Number: " << fRun FileName;1271 str << "Run Number: " << fRunNumber; 1272 1272 Message(str.str()); 1273 1273 Message("----------- OPENED FILES ----------------"); … … 1387 1387 Message("Server "+it->first); 1388 1388 for (std::map<std::string, SubscriptionType>::const_iterator it2=it->second.begin(); it2!=it->second.end(); it2++) 1389 Message(" -> "+it2->first);1389 Message(" -> "+it2->first); 1390 1390 } 1391 1391 if (fIsBlackList) … … 1395 1395 Message("----------- ALLOW LIST ------------------"); 1396 1396 for (set<string>::iterator it=fGreyList.begin(); it != fGreyList.end(); it++) 1397 Message(*it); 1397 Message(*it); 1398 1399 if (fGreyList.size()==0) 1400 Message(" <empty>"); 1401 1398 1402 return GetCurrentState(); 1399 1403 } … … 2083 2087 } 2084 2088 2085 void DataLogger::Setup(Configuration& conf) 2086 { 2089 bool DataLogger::SetConfiguration(Configuration& conf) 2090 { 2091 fDebugIsOn = conf.Get<bool>("debug"); 2092 2087 2093 //Set the block or allow list 2088 2094 fGreyList.clear(); … … 2113 2119 } 2114 2120 } 2121 2122 return true; 2115 2123 } 2116 2124 /* … … 2148 2156 // Start io_service.run to only use the commandHandler command detaching 2149 2157 DataLogger logger(wout); 2158 if (!logger.SetConfiguration(conf)) 2159 return -1; 2160 2150 2161 logger.Run(true); 2151 2162 … … 2174 2185 2175 2186 DataLogger logger(wout); 2187 if (!logger.SetConfiguration(conf)) 2188 return -1; 2176 2189 2177 logger.Setup(conf);2178 2179 2190 shell.SetReceiver(logger); 2180 2191 … … 2256 2267 const string n = conf.GetName()+".log"; 2257 2268 2258 po::options_description config ("Program options");2259 config .add_options()2269 po::options_description configp("Program options"); 2270 configp.add_options() 2260 2271 ("dns", var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)") 2261 2272 ("log,l", var<string>(n), "Write log-file") 2262 2273 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)") 2263 ("block,b", vars<string>(), "Black-list of services")2264 ("allow,a", vars<string>(), "White-list of services")2265 2274 ; 2266 2275 2276 po::options_description configs("Scheduler options"); 2277 configs.add_options() 2278 ("block,b", vars<string>(), "Black-list of services") 2279 ("allow,a", vars<string>(), "White-list of services") 2280 ("debug", po_bool(), "Debug mode. Print clear text of received service reports to log-stream") 2281 ; 2282 2267 2283 conf.AddEnv("dns", "DIM_DNS_NODE"); 2268 2284 2269 conf.AddOptions(config); 2285 conf.AddOptions(configp); 2286 conf.AddOptions(configs); 2270 2287 } 2271 2288 … … 2312 2329 Dim::Setup(conf.Get<string>("dns")); 2313 2330 2314 try2331 // try 2315 2332 { 2316 2333 // No console access at all … … 2324 2341 return RunShell<LocalConsole>(conf); 2325 2342 } 2326 catch (std::exception& e)2343 /* catch (std::exception& e) 2327 2344 { 2328 2345 cerr << "Exception: " << e.what() << endl; 2329 2346 return -1; 2330 } 2347 }*/ 2331 2348 2332 2349 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.