@@ -168,23 +168,26 @@ namespace pfasst
168168 id2print.append (LOGGER_ID_LENGTH - id_length, ' ' );
169169 }
170170
171+ el::Configurations* default_conf = \
172+ const_cast <el::Configurations*>(el::Loggers::defaultConfigurations ());
173+
171174 el::Logger* logger = el::Loggers::getLogger (id);
172175 el::Configurations* conf = logger->configurations ();
173176 conf->setGlobally (el::ConfigurationType::MillisecondsWidth,
174- PFASST_LOGGER_DEFAULT_GLOBAL_MILLISECOND_WIDTH);
177+ default_conf->get (el::Level::Info,
178+ el::ConfigurationType::MillisecondsWidth)->value ());
179+ conf->setGlobally (el::ConfigurationType::ToStandardOutput,
180+ default_conf->get (el::Level::Info,
181+ el::ConfigurationType::ToStandardOutput)->value ());
175182#ifdef WITH_MPI
176183 int initialized = 0 ;
177184 MPI_Initialized (&initialized);
178185 assert ((bool )initialized);
179186 int rank = 0 ;
180187 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
181188 conf->setGlobally (el::ConfigurationType::ToFile, " true" );
182- conf->setGlobally (el::ConfigurationType::ToStandardOutput, " false" );
183189 conf->setGlobally (el::ConfigurationType::Filename,
184190 string (" mpi_run_" ) + to_string (rank) + string (" .log" ));
185- #else
186- conf->setGlobally (el::ConfigurationType::ToFile, " false" );
187- conf->setGlobally (el::ConfigurationType::ToStandardOutput, " true" );
188191#endif
189192 conf->set (el::Level::Info, el::ConfigurationType::Format,
190193 TIMESTAMP + INFO_COLOR + " [" + id2print + " , " + LEVEL + " " + MESSAGE + OUT::reset);
@@ -209,22 +212,24 @@ namespace pfasst
209212 el::Configurations defaultConf;
210213 defaultConf.setToDefault ();
211214
215+ if (!pfasst::config::options::get_instance ().get_variables_map ().count (" quiet" )) {
216+ defaultConf.setGlobally (el::ConfigurationType::ToStandardOutput, " true" );
217+ } else {
218+ defaultConf.setGlobally (el::ConfigurationType::ToStandardOutput, " false" );
219+ }
212220#ifdef WITH_MPI
213221 int initialized = 0 ;
214222 MPI_Initialized (&initialized);
215223 assert ((bool )initialized);
216224 int rank = 0 ;
217225 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
218226 defaultConf.setGlobally (el::ConfigurationType::ToFile, " true" );
219- defaultConf.setGlobally (el::ConfigurationType::ToStandardOutput, " false" );
220227 defaultConf.setGlobally (el::ConfigurationType::Filename,
221228 string (" mpi_run_" ) + to_string (rank) + string (" .log" ));
222- #else
223- defaultConf.setGlobally (el::ConfigurationType::ToFile, " false" );
224- defaultConf.setGlobally (el::ConfigurationType::ToStandardOutput, " true" );
225229#endif
226- defaultConf.setGlobally (el::ConfigurationType::MillisecondsWidth, PFASST_LOGGER_DEFAULT_GLOBAL_MILLISECOND_WIDTH);
227- el::Loggers::reconfigureAllLoggers (defaultConf);
230+ defaultConf.setGlobally (el::ConfigurationType::MillisecondsWidth,
231+ PFASST_LOGGER_DEFAULT_GLOBAL_MILLISECOND_WIDTH);
232+ el::Loggers::setDefaultConfigurations (defaultConf, true );
228233
229234 add_custom_logger (" default" );
230235 add_custom_logger (" Controller" );
0 commit comments