diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt index ebb1d410130374a26f2f14aec74c380d81bc48de..a1e7954b98653a5a225dc8ce496a9400e126a30b 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 92950ae740f3bb01f9804f9ab5ff1b0902dfc5f8..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..fa5417103993a631dfb126d53f4a50d06745f74d --- /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 126ccc373b2abf72d8d839e7944d9ee72590d2ab..5fb15bb647334e397e793a2fad1d56af3778e175 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 0000000000000000000000000000000000000000..b2af595850c61a2a8fe150b32f35e637f5407cb5 --- /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 4cc054052242d4157432fb89908390fac7116d43..f350dec73d477e6e05d4376f61935a3d9b705794 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");