From acda4b09bf812e8e6d45e1509863b1f9e4a037e0 Mon Sep 17 00:00:00 2001 From: Andrei Savici <saviciat@ornl.gov> Date: Fri, 26 Apr 2013 11:53:15 -0400 Subject: [PATCH] Renamed StdChannel to StdoutChannel. Refs #6933 --- Code/Mantid/Framework/Kernel/CMakeLists.txt | 8 ++++---- .../Kernel/inc/MantidKernel/StdChannel.h | 16 ---------------- .../Kernel/inc/MantidKernel/StdoutChannel.h | 16 ++++++++++++++++ .../Framework/Kernel/src/ConfigService.cpp | 6 +++--- .../Framework/Kernel/src/StdoutChannel.cpp | 12 ++++++++++++ .../{StdChannelTest.h => StdoutChannelTest.h} | 10 +++++----- 6 files changed, 40 insertions(+), 28 deletions(-) delete mode 100644 Code/Mantid/Framework/Kernel/inc/MantidKernel/StdChannel.h create mode 100644 Code/Mantid/Framework/Kernel/inc/MantidKernel/StdoutChannel.h create mode 100644 Code/Mantid/Framework/Kernel/src/StdoutChannel.cpp rename Code/Mantid/Framework/Kernel/test/{StdChannelTest.h => StdoutChannelTest.h} (89%) diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt index ebb1d410130..a1e7954b986 100644 --- a/Code/Mantid/Framework/Kernel/CMakeLists.txt +++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt @@ -69,7 +69,7 @@ set ( SRC_FILES src/SobolSequence.cpp src/StartsWithValidator.cpp src/Statistics.cpp - src/StdChannel.cpp + src/StdoutChannel.cpp src/Strings.cpp src/TestChannel.cpp src/ThreadPool.cpp @@ -195,7 +195,7 @@ set ( INC_FILES inc/MantidKernel/SobolSequence.h inc/MantidKernel/StartsWithValidator.h inc/MantidKernel/Statistics.h - inc/MantidKernel/StdChannel.h + inc/MantidKernel/StdoutChannel.h inc/MantidKernel/Strings.h inc/MantidKernel/System.h inc/MantidKernel/Task.h @@ -242,7 +242,7 @@ set ( TEST_FILES DateValidatorTest.h DeltaEModeTest.h DirectoryValidatorTest.h - DiskBufferISaveableTest.h + DiskBufferISaveableTest.h DiskBufferTest.h DynamicFactoryTest.h EnabledWhenPropertyTest.h @@ -295,7 +295,7 @@ set ( TEST_FILES SobolSequenceTest.h StartsWithValidatorTest.h StatisticsTest.h - StdChannelTest.h + StdoutChannelTest.h StringsTest.h TaskTest.h ThreadPoolRunnableTest.h diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/StdChannel.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/StdChannel.h deleted file mode 100644 index 92950ae740f..00000000000 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/StdChannel.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef STDCHANNEL_H -#define STDCHANNEL_H - -#include <MantidKernel/DllConfig.h> -#include <Poco/ConsoleChannel.h> -namespace Poco{ -class MANTID_KERNEL_DLL StdChannel : public ConsoleChannel -{ - public: - /// Constructor for StdChannel - StdChannel(); - /// destructor - ~StdChannel(); -}; -} -#endif // STDCHANNEL_H diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/StdoutChannel.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/StdoutChannel.h new file mode 100644 index 00000000000..fa541710399 --- /dev/null +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/StdoutChannel.h @@ -0,0 +1,16 @@ +#ifndef STDOUTCHANNEL_H +#define STDOUTCHANNEL_H + +#include <MantidKernel/DllConfig.h> +#include <Poco/ConsoleChannel.h> +namespace Poco{ +class MANTID_KERNEL_DLL StdoutChannel : public ConsoleChannel +{ + public: + /// Constructor for StdChannel + StdoutChannel(); + /// destructor + ~StdoutChannel(); +}; +} +#endif // STDOUTCHANNEL_H diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp index 126ccc373b2..5fb15bb6473 100644 --- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp +++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp @@ -7,7 +7,7 @@ #include "MantidKernel/Strings.h" #include "MantidKernel/Logger.h" #include "MantidKernel/FilterChannel.h" -#include "MantidKernel/StdChannel.h" +#include "MantidKernel/StdoutChannel.h" #include "MantidKernel/Exception.h" #include "MantidKernel/FacilityInfo.h" @@ -184,8 +184,8 @@ ConfigServiceImpl::ConfigServiceImpl() : Poco::LoggingFactory::defaultFactory().registerChannelClass("FilterChannel", new Poco::Instantiator< Poco::FilterChannel, Poco::Channel>); //Register StdChannel with Poco - Poco::LoggingFactory::defaultFactory().registerChannelClass("StdChannel", new Poco::Instantiator< - Poco::StdChannel, Poco::Channel>); + Poco::LoggingFactory::defaultFactory().registerChannelClass("StdoutChannel", new Poco::Instantiator< + Poco::StdoutChannel, Poco::Channel>); // Define the directory to search for the Mantid.properties file. Poco::File f; diff --git a/Code/Mantid/Framework/Kernel/src/StdoutChannel.cpp b/Code/Mantid/Framework/Kernel/src/StdoutChannel.cpp new file mode 100644 index 00000000000..b2af595850c --- /dev/null +++ b/Code/Mantid/Framework/Kernel/src/StdoutChannel.cpp @@ -0,0 +1,12 @@ +#include <MantidKernel/StdoutChannel.h> +#include <iostream> + +namespace Poco { +StdoutChannel::StdoutChannel():ConsoleChannel(std::cout) +{ +} +StdoutChannel::~StdoutChannel() +{ +} + +} diff --git a/Code/Mantid/Framework/Kernel/test/StdChannelTest.h b/Code/Mantid/Framework/Kernel/test/StdoutChannelTest.h similarity index 89% rename from Code/Mantid/Framework/Kernel/test/StdChannelTest.h rename to Code/Mantid/Framework/Kernel/test/StdoutChannelTest.h index 4cc05405224..f350dec73d4 100644 --- a/Code/Mantid/Framework/Kernel/test/StdChannelTest.h +++ b/Code/Mantid/Framework/Kernel/test/StdoutChannelTest.h @@ -1,9 +1,9 @@ -#ifndef MANTID_STDCHANNELTEST_H_ -#define MANTID_STDCHANNELTEST_H_ +#ifndef MANTID_STDOUTCHANNELTEST_H_ +#define MANTID_STDOUTCHANNELTEST_H_ #include <cxxtest/TestSuite.h> -#include "MantidKernel/StdChannel.h" +#include "MantidKernel/StdoutChannel.h" #include "MantidKernel/Logger.h" #include <iostream> #include <Poco/Logger.h> @@ -18,7 +18,7 @@ public: void testContructor() { - TS_ASSERT_THROWS_NOTHING(Poco::StdChannel a;) + TS_ASSERT_THROWS_NOTHING(Poco::StdoutChannel a;) } @@ -57,7 +57,7 @@ public: lbuffer.str(""); //Test std channel - Poco::Logger::root().setChannel(new Poco::StdChannel); + Poco::Logger::root().setChannel(new Poco::StdoutChannel); log.error() << "Error Message 3" << std::endl; //the error should be in std::cout TS_ASSERT_EQUALS(obuffer.str(),"Error Message 3\n"); -- GitLab