diff --git a/Framework/Kernel/inc/MantidKernel/ConfigService.h b/Framework/Kernel/inc/MantidKernel/ConfigService.h index bf14c00ff5314363e992028a72da0888b1a9ad1e..e22ad3433e9a73e908b833728bb9e3d7e3951e8f 100644 --- a/Framework/Kernel/inc/MantidKernel/ConfigService.h +++ b/Framework/Kernel/inc/MantidKernel/ConfigService.h @@ -240,7 +240,7 @@ public: void setConsoleLogLevel(int logLevel); /// Sets the log level priority for the selected Filter log channel void setFilterChannelLogLevel(const std::string &filterChannelName, - int logLevel); + int logLevel, bool quiet = false); /// Look for an instrument const InstrumentInfo & diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index 7510ee3036c4d67dd08601002f81389b6d078b22..b2092a303b8d72cc84808b8edd74c377eaef72fa 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -2036,11 +2036,12 @@ void ConfigServiceImpl::setConsoleLogLevel(int logLevel) { /** Sets the Log level for a filter channel * @param filterChannelName the channel name of the filter channel to change * @param logLevel the integer value of the log level to set, 1=Critical, 7=Debug +* @param quiet If true then no message regarding the level change is emitted * @throws std::invalid_argument if the channel name is incorrect or it is not a * filterChannel */ void ConfigServiceImpl::setFilterChannelLogLevel( - const std::string &filterChannelName, int logLevel) { + const std::string &filterChannelName, int logLevel, bool quiet) { Poco::Channel *channel = nullptr; try { channel = Poco::LoggingRegistry::defaultRegistry().channelForName( @@ -2059,9 +2060,11 @@ void ConfigServiceImpl::setFilterChannelLogLevel( if (rootLevel != lowestLogLevel) { Mantid::Kernel::Logger::setLevelForAll(lowestLogLevel); } - g_log.log(filterChannelName + " log channel set to " + - Logger::PriorityNames[logLevel] + " priority", - static_cast<Logger::Priority>(logLevel)); + if (!quiet) { + g_log.log(filterChannelName + " log channel set to " + + Logger::PriorityNames[logLevel] + " priority", + static_cast<Logger::Priority>(logLevel)); + } } else { throw std::invalid_argument(filterChannelName + " was not a filter channel");