Skip to content

Commit

Permalink
Renamed StdChannel to StdoutChannel. Refs #6933
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiSavici committed Apr 26, 2013
1 parent 307ddb8 commit acda4b0
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -242,7 +242,7 @@ set ( TEST_FILES
DateValidatorTest.h
DeltaEModeTest.h
DirectoryValidatorTest.h
DiskBufferISaveableTest.h
DiskBufferISaveableTest.h
DiskBufferTest.h
DynamicFactoryTest.h
EnabledWhenPropertyTest.h
Expand Down Expand Up @@ -295,7 +295,7 @@ set ( TEST_FILES
SobolSequenceTest.h
StartsWithValidatorTest.h
StatisticsTest.h
StdChannelTest.h
StdoutChannelTest.h
StringsTest.h
TaskTest.h
ThreadPoolRunnableTest.h
Expand Down
16 changes: 0 additions & 16 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/StdChannel.h

This file was deleted.

16 changes: 16 additions & 0 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/StdoutChannel.h
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/Kernel/src/ConfigService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions Code/Mantid/Framework/Kernel/src/StdoutChannel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <MantidKernel/StdoutChannel.h>
#include <iostream>

namespace Poco {
StdoutChannel::StdoutChannel():ConsoleChannel(std::cout)
{
}
StdoutChannel::~StdoutChannel()
{
}

}
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -18,7 +18,7 @@ class StdChannelTest : public CxxTest::TestSuite

void testContructor()
{
TS_ASSERT_THROWS_NOTHING(Poco::StdChannel a;)
TS_ASSERT_THROWS_NOTHING(Poco::StdoutChannel a;)
}


Expand Down Expand Up @@ -57,7 +57,7 @@ class StdChannelTest : public CxxTest::TestSuite
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");
Expand Down

0 comments on commit acda4b0

Please sign in to comment.