From cbec163780d32f1951bd6f22b62665501ecad5ea Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 18 Nov 2020 16:22:03 -0600 Subject: [PATCH] Code improvements based on a code-review --- .../src/ThreadSafeLogMessageLoggerScribe.cc | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc index 75adeb002b054..712cd3404fe85 100644 --- a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc +++ b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc @@ -38,9 +38,8 @@ namespace edm { namespace service { ThreadSafeLogMessageLoggerScribe::ThreadSafeLogMessageLoggerScribe() - : m_admin_p(new ELadministrator()), + : m_admin_p(std::make_shared()), m_early_dest(m_admin_p->attach(std::make_shared(std::cerr, false))), - m_file_ps(), m_clean_slate_configuration(true), m_active(true), m_purge_mode(false), @@ -235,7 +234,7 @@ namespace edm { for (auto const& name : files.getParameterNamesForType(false)) { categories.merge(findCategoriesInDestination(files.getUntrackedParameter(name))); } - categories.merge(std::set(psets.begin(), psets.end())); + categories.insert(psets.begin(), psets.end()); return std::vector(categories.begin(), categories.end()); } @@ -269,16 +268,12 @@ namespace edm { } // Attach a default extension of .log if there is no extension on a file - // change log 18 - this had been done in concert with attaching destination - - std::string actual_filename = filename; // change log 4 if ((filename != "cout") && (filename != "cerr")) { - const std::string::size_type npos = std::string::npos; - if (filename.find('.') == npos) { - actual_filename += ".log"; + if (filename.find('.') == std::string::npos) { + filename += ".log"; } } - return actual_filename; + return filename; } void ThreadSafeLogMessageLoggerScribe::configure_errorlog_new(edm::ParameterSet& job_pset) { @@ -921,17 +916,8 @@ namespace edm { destination_base.addOptionalUntracked("threshold"); destination_base.addOptionalUntracked("statisticsThreshold"); - /* - destination_base.addUntracked("DEBUG",category); - destination_base.addUntracked("INFO", category); - destination_base.addUntracked("FWKINFO",category); - destination_base.addUntracked("WARNING",category); - destination_base.addUntracked("ERROR",category); - */ - edm::ParameterWildcard catnode("*", edm::RequireZeroOrMore, false, category); catnode.setComment("Specialize either a category or any of 'DEBUG', 'INFO', 'FWKINFO', 'WARNING' or 'ERROR'"); - //destination_base.addWildcardUntracked(category); destination_base.addNode(catnode); edm::ParameterSetDescription destination_noStats(destination_base);