mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-03 12:07:55 +00:00
Poco::LoggingFactory::registerBuiltins should support SimpleFileChannel. #197
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
#include "Poco/AsyncChannel.h"
|
#include "Poco/AsyncChannel.h"
|
||||||
#include "Poco/ConsoleChannel.h"
|
#include "Poco/ConsoleChannel.h"
|
||||||
#include "Poco/FileChannel.h"
|
#include "Poco/FileChannel.h"
|
||||||
|
#include "Poco/SimpleFileChannel.h"
|
||||||
#include "Poco/FormattingChannel.h"
|
#include "Poco/FormattingChannel.h"
|
||||||
#include "Poco/SplitterChannel.h"
|
#include "Poco/SplitterChannel.h"
|
||||||
#include "Poco/NullChannel.h"
|
#include "Poco/NullChannel.h"
|
||||||
@@ -24,9 +25,6 @@
|
|||||||
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_NO_SYSLOGCHANNEL)
|
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_NO_SYSLOGCHANNEL)
|
||||||
#include "Poco/SyslogChannel.h"
|
#include "Poco/SyslogChannel.h"
|
||||||
#endif
|
#endif
|
||||||
#if defined(POCO_OS_FAMILY_VMS)
|
|
||||||
#include "Poco/OpcomChannel.h"
|
|
||||||
#endif
|
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE)
|
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE)
|
||||||
#include "Poco/EventLogChannel.h"
|
#include "Poco/EventLogChannel.h"
|
||||||
#include "Poco/WindowsConsoleChannel.h"
|
#include "Poco/WindowsConsoleChannel.h"
|
||||||
@@ -94,8 +92,10 @@ void LoggingFactory::registerBuiltins()
|
|||||||
_channelFactory.registerClass("ConsoleChannel", new Instantiator<ConsoleChannel, Channel>);
|
_channelFactory.registerClass("ConsoleChannel", new Instantiator<ConsoleChannel, Channel>);
|
||||||
_channelFactory.registerClass("ColorConsoleChannel", new Instantiator<ColorConsoleChannel, Channel>);
|
_channelFactory.registerClass("ColorConsoleChannel", new Instantiator<ColorConsoleChannel, Channel>);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef POCO_NO_FILECHANNEL
|
#ifndef POCO_NO_FILECHANNEL
|
||||||
_channelFactory.registerClass("FileChannel", new Instantiator<FileChannel, Channel>);
|
_channelFactory.registerClass("FileChannel", new Instantiator<FileChannel, Channel>);
|
||||||
|
_channelFactory.registerClass("SimpleFileChannel", new Instantiator<SimpleFileChannel, Channel>);
|
||||||
#endif
|
#endif
|
||||||
_channelFactory.registerClass("FormattingChannel", new Instantiator<FormattingChannel, Channel>);
|
_channelFactory.registerClass("FormattingChannel", new Instantiator<FormattingChannel, Channel>);
|
||||||
#ifndef POCO_NO_SPLITTERCHANNEL
|
#ifndef POCO_NO_SPLITTERCHANNEL
|
||||||
@@ -109,9 +109,7 @@ void LoggingFactory::registerBuiltins()
|
|||||||
_channelFactory.registerClass("SyslogChannel", new Instantiator<SyslogChannel, Channel>);
|
_channelFactory.registerClass("SyslogChannel", new Instantiator<SyslogChannel, Channel>);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(POCO_OS_FAMILY_VMS)
|
|
||||||
_channelFactory.registerClass("OpcomChannel", new Instantiator<OpcomChannel, Channel>);
|
|
||||||
#endif
|
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE)
|
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE)
|
||||||
_channelFactory.registerClass("EventLogChannel", new Instantiator<EventLogChannel, Channel>);
|
_channelFactory.registerClass("EventLogChannel", new Instantiator<EventLogChannel, Channel>);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,7 +18,10 @@
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include "Poco/WindowsConsoleChannel.h"
|
#include "Poco/WindowsConsoleChannel.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef POCO_NO_FILECHANNEL
|
||||||
#include "Poco/FileChannel.h"
|
#include "Poco/FileChannel.h"
|
||||||
|
#include "Poco/SimpleFileChannel.h"
|
||||||
|
#endif
|
||||||
#include "Poco/SplitterChannel.h"
|
#include "Poco/SplitterChannel.h"
|
||||||
#include "Poco/Formatter.h"
|
#include "Poco/Formatter.h"
|
||||||
#include "Poco/PatternFormatter.h"
|
#include "Poco/PatternFormatter.h"
|
||||||
@@ -31,7 +34,10 @@
|
|||||||
using Poco::LoggingFactory;
|
using Poco::LoggingFactory;
|
||||||
using Poco::Channel;
|
using Poco::Channel;
|
||||||
using Poco::ConsoleChannel;
|
using Poco::ConsoleChannel;
|
||||||
|
#ifndef POCO_NO_FILECHANNEL
|
||||||
using Poco::FileChannel;
|
using Poco::FileChannel;
|
||||||
|
using Poco::SimpleFileChannel;
|
||||||
|
#endif
|
||||||
using Poco::SplitterChannel;
|
using Poco::SplitterChannel;
|
||||||
using Poco::Formatter;
|
using Poco::Formatter;
|
||||||
using Poco::PatternFormatter;
|
using Poco::PatternFormatter;
|
||||||
@@ -80,9 +86,14 @@ void LoggingFactoryTest::testBuiltins()
|
|||||||
assert (dynamic_cast<ConsoleChannel*>(pConsoleChannel.get()) != 0);
|
assert (dynamic_cast<ConsoleChannel*>(pConsoleChannel.get()) != 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef POCO_NO_FILECHANNEL
|
||||||
AutoPtr<Channel> pFileChannel = fact.createChannel("FileChannel");
|
AutoPtr<Channel> pFileChannel = fact.createChannel("FileChannel");
|
||||||
assert (dynamic_cast<FileChannel*>(pFileChannel.get()) != 0);
|
assert (dynamic_cast<FileChannel*>(pFileChannel.get()) != 0);
|
||||||
|
|
||||||
|
AutoPtr<Channel> pSimpleFileChannel = fact.createChannel("SimpleFileChannel");
|
||||||
|
assert(dynamic_cast<SimpleFileChannel*>(pSimpleFileChannel.get()) != 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
AutoPtr<Channel> pSplitterChannel = fact.createChannel("SplitterChannel");
|
AutoPtr<Channel> pSplitterChannel = fact.createChannel("SplitterChannel");
|
||||||
assert (dynamic_cast<SplitterChannel*>(pSplitterChannel.get()) != 0);
|
assert (dynamic_cast<SplitterChannel*>(pSplitterChannel.get()) != 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user