added EventChannel class (from macchina.io)

This commit is contained in:
Guenter Obiltschnig 2015-09-30 11:03:03 +02:00
parent 7f9dff45c0
commit 92e2a19661
27 changed files with 191 additions and 2 deletions

View File

@ -2138,6 +2138,8 @@
RelativePath=".\src\Configurable.cpp"/>
<File
RelativePath=".\src\ConsoleChannel.cpp"/>
<File
RelativePath=".\src\EventChannel.cpp"/>
<File
RelativePath=".\src\EventLogChannel.cpp"/>
<File
@ -2421,6 +2423,8 @@
RelativePath=".\include\Poco\Configurable.h"/>
<File
RelativePath=".\include\Poco\ConsoleChannel.h"/>
<File
RelativePath=".\include\Poco\EventChannel.h"/>
<File
RelativePath=".\include\Poco\EventLogChannel.h"/>
<File

View File

@ -679,6 +679,7 @@
<ClCompile Include="src\Channel.cpp" />
<ClCompile Include="src\Configurable.cpp" />
<ClCompile Include="src\ConsoleChannel.cpp" />
<ClCompile Include="src\EventChannel.cpp" />
<ClCompile Include="src\EventLogChannel.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V300'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V300'">true</ExcludedFromBuild>
@ -1255,6 +1256,7 @@
<ClInclude Include="include\Poco\Channel.h" />
<ClInclude Include="include\Poco\Configurable.h" />
<ClInclude Include="include\Poco\ConsoleChannel.h" />
<ClInclude Include="include\Poco\EventChannel.h" />
<ClInclude Include="include\Poco\EventLogChannel.h" />
<ClInclude Include="include\Poco\FileChannel.h" />
<ClInclude Include="include\Poco\Formatter.h" />

View File

@ -567,6 +567,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1418,6 +1421,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -679,6 +679,7 @@
<ClCompile Include="src\Channel.cpp" />
<ClCompile Include="src\Configurable.cpp" />
<ClCompile Include="src\ConsoleChannel.cpp" />
<ClCompile Include="src\EventChannel.cpp" />
<ClCompile Include="src\EventLogChannel.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|SDK_AM335X_SK_WEC2013_V310'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|SDK_AM335X_SK_WEC2013_V310'">true</ExcludedFromBuild>
@ -1255,6 +1256,7 @@
<ClInclude Include="include\Poco\Channel.h" />
<ClInclude Include="include\Poco\Configurable.h" />
<ClInclude Include="include\Poco\ConsoleChannel.h" />
<ClInclude Include="include\Poco\EventChannel.h" />
<ClInclude Include="include\Poco\EventLogChannel.h" />
<ClInclude Include="include\Poco\FileChannel.h" />
<ClInclude Include="include\Poco\Formatter.h" />

View File

@ -567,6 +567,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1418,6 +1421,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -608,6 +608,7 @@
<ClCompile Include="src\Channel.cpp"/>
<ClCompile Include="src\Configurable.cpp"/>
<ClCompile Include="src\ConsoleChannel.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\FileChannel.cpp"/>
<ClCompile Include="src\Formatter.cpp"/>
@ -1151,6 +1152,7 @@
<ClInclude Include="include\Poco\Channel.h"/>
<ClInclude Include="include\Poco\Configurable.h"/>
<ClInclude Include="include\Poco\ConsoleChannel.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\FileChannel.h"/>
<ClInclude Include="include\Poco\Formatter.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -612,6 +612,7 @@
<ClCompile Include="src\Channel.cpp"/>
<ClCompile Include="src\Configurable.cpp"/>
<ClCompile Include="src\ConsoleChannel.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\FileChannel.cpp"/>
<ClCompile Include="src\Formatter.cpp"/>
@ -1155,6 +1156,7 @@
<ClInclude Include="include\Poco\Channel.h"/>
<ClInclude Include="include\Poco\Configurable.h"/>
<ClInclude Include="include\Poco\ConsoleChannel.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\FileChannel.h"/>
<ClInclude Include="include\Poco\Formatter.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -612,6 +612,7 @@
<ClCompile Include="src\Channel.cpp"/>
<ClCompile Include="src\Configurable.cpp"/>
<ClCompile Include="src\ConsoleChannel.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\FileChannel.cpp"/>
<ClCompile Include="src\Formatter.cpp"/>
@ -1155,6 +1156,7 @@
<ClInclude Include="include\Poco\Channel.h"/>
<ClInclude Include="include\Poco\Configurable.h"/>
<ClInclude Include="include\Poco\ConsoleChannel.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\FileChannel.h"/>
<ClInclude Include="include\Poco\Formatter.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -392,6 +392,7 @@
<ClCompile Include="src\ErrorHandler.cpp"/>
<ClCompile Include="src\Event.cpp"/>
<ClCompile Include="src\EventArgs.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\Event_POSIX.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
@ -1079,6 +1080,7 @@
<ClInclude Include="include\Poco\ErrorHandler.h"/>
<ClInclude Include="include\Poco\Event.h"/>
<ClInclude Include="include\Poco\EventArgs.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\Event_POSIX.h"/>
<ClInclude Include="include\Poco\Event_WIN32.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -2092,6 +2092,8 @@
RelativePath=".\src\Configurable.cpp"/>
<File
RelativePath=".\src\ConsoleChannel.cpp"/>
<File
RelativePath=".\src\EventChannel.cpp"/>
<File
RelativePath=".\src\EventLogChannel.cpp"/>
<File
@ -2375,6 +2377,8 @@
RelativePath=".\include\Poco\Configurable.h"/>
<File
RelativePath=".\include\Poco\ConsoleChannel.h"/>
<File
RelativePath=".\include\Poco\EventChannel.h"/>
<File
RelativePath=".\include\Poco\EventLogChannel.h"/>
<File

View File

@ -606,6 +606,7 @@
<ClCompile Include="src\Channel.cpp"/>
<ClCompile Include="src\Configurable.cpp"/>
<ClCompile Include="src\ConsoleChannel.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\FileChannel.cpp"/>
<ClCompile Include="src\Formatter.cpp"/>
@ -1149,6 +1150,7 @@
<ClInclude Include="include\Poco\Channel.h"/>
<ClInclude Include="include\Poco\Configurable.h"/>
<ClInclude Include="include\Poco\ConsoleChannel.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\FileChannel.h"/>
<ClInclude Include="include\Poco\Formatter.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -610,6 +610,7 @@
<ClCompile Include="src\Channel.cpp"/>
<ClCompile Include="src\Configurable.cpp"/>
<ClCompile Include="src\ConsoleChannel.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\FileChannel.cpp"/>
<ClCompile Include="src\Formatter.cpp"/>
@ -1153,6 +1154,7 @@
<ClInclude Include="include\Poco\Channel.h"/>
<ClInclude Include="include\Poco\Configurable.h"/>
<ClInclude Include="include\Poco\ConsoleChannel.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\FileChannel.h"/>
<ClInclude Include="include\Poco\Formatter.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -610,6 +610,7 @@
<ClCompile Include="src\Channel.cpp"/>
<ClCompile Include="src\Configurable.cpp"/>
<ClCompile Include="src\ConsoleChannel.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\FileChannel.cpp"/>
<ClCompile Include="src\Formatter.cpp"/>
@ -1153,6 +1154,7 @@
<ClInclude Include="include\Poco\Channel.h"/>
<ClInclude Include="include\Poco\Configurable.h"/>
<ClInclude Include="include\Poco\ConsoleChannel.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\FileChannel.h"/>
<ClInclude Include="include\Poco\Formatter.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -390,6 +390,7 @@
<ClCompile Include="src\ErrorHandler.cpp"/>
<ClCompile Include="src\Event.cpp"/>
<ClCompile Include="src\EventArgs.cpp"/>
<ClCompile Include="src\EventChannel.cpp"/>
<ClCompile Include="src\EventLogChannel.cpp"/>
<ClCompile Include="src\Event_POSIX.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
@ -1077,6 +1078,7 @@
<ClInclude Include="include\Poco\ErrorHandler.h"/>
<ClInclude Include="include\Poco\Event.h"/>
<ClInclude Include="include\Poco\EventArgs.h"/>
<ClInclude Include="include\Poco\EventChannel.h"/>
<ClInclude Include="include\Poco\EventLogChannel.h"/>
<ClInclude Include="include\Poco\Event_POSIX.h"/>
<ClInclude Include="include\Poco\Event_WIN32.h"/>

View File

@ -579,6 +579,9 @@
<ClCompile Include="src\ConsoleChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EventLogChannel.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
@ -1406,6 +1409,9 @@
<ClInclude Include="include\Poco\ConsoleChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\EventLogChannel.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>

View File

@ -2097,6 +2097,8 @@
RelativePath=".\src\Configurable.cpp"/>
<File
RelativePath=".\src\ConsoleChannel.cpp"/>
<File
RelativePath=".\src\EventChannel.cpp"/>
<File
RelativePath=".\src\EventLogChannel.cpp"/>
<File
@ -2380,6 +2382,8 @@
RelativePath=".\include\Poco\Configurable.h"/>
<File
RelativePath=".\include\Poco\ConsoleChannel.h"/>
<File
RelativePath=".\include\Poco\EventChannel.h"/>
<File
RelativePath=".\include\Poco\EventLogChannel.h"/>
<File

View File

@ -13,8 +13,8 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel \
BinaryReader BinaryWriter Bugcheck ByteOrder Channel Checksum Clock Configurable ConsoleChannel \
Condition CountingStream DateTime LocalDateTime DateTimeFormat DateTimeFormatter DateTimeParser \
Debugger DeflatingStream DigestEngine DigestStream DirectoryIterator DirectoryWatcher \
Environment Event Error EventArgs ErrorHandler Exception FIFOBufferStream FPEnvironment File \
FileChannel Formatter FormattingChannel Glob HexBinaryDecoder LineEndingConverter \
Environment Event Error EventArgs EventChannel ErrorHandler Exception FIFOBufferStream FPEnvironment \
File FileChannel Formatter FormattingChannel Glob HexBinaryDecoder LineEndingConverter \
HexBinaryEncoder InflatingStream JSONString Latin1Encoding Latin2Encoding Latin9Encoding \
LogFile Logger LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \
MemoryPool MD4Engine MD5Engine Manifest Message Mutex \

View File

@ -0,0 +1,56 @@
//
// EventChannel.h
//
// $Id$
//
// Library: Foundation
// Package: Logging
// Module: EventChannel
//
// Definition of the EventChannel class.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_EventChannel_INCLUDED
#define Foundation_EventChannel_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Channel.h"
#include "Poco/Message.h"
#include "Poco/BasicEvent.h"
namespace Poco {
class Foundation_API EventChannel: public Channel
/// The EventChannel fires the messageLogged event for every log message
/// received. This can be used to hook custom log message processing into
/// the logging framework.
{
public:
Poco::BasicEvent<const Message> messageLogged;
/// Fired when a message is logged by calling the log() method.
EventChannel();
/// Creates the EventChannel.
void log(const Message& msg);
/// Fires the messageLogged event.
protected:
~EventChannel();
/// Destroys the EventChannel.
};
} // namespace Poco
#endif // Foundation_EventChannel_INCLUDED

View File

@ -0,0 +1,39 @@
//
// EventChannel.cpp
//
// $Id$
//
// Library: Foundation
// Package: Logging
// Module: EventChannel
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/EventChannel.h"
namespace Poco {
EventChannel::EventChannel()
{
}
EventChannel::~EventChannel()
{
}
void EventChannel::log(const Message& msg)
{
messageLogged(this, msg);
}
} // namespace Poco

View File

@ -22,6 +22,7 @@
#include "Poco/FormattingChannel.h"
#include "Poco/SplitterChannel.h"
#include "Poco/NullChannel.h"
#include "Poco/EventChannel.h"
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_NO_SYSLOGCHANNEL)
#include "Poco/SyslogChannel.h"
#endif
@ -103,6 +104,7 @@ void LoggingFactory::registerBuiltins()
_channelFactory.registerClass("SplitterChannel", new Instantiator<SplitterChannel, Channel>);
#endif
_channelFactory.registerClass("NullChannel", new Instantiator<NullChannel, Channel>);
_channelFactory.registerClass("EventChannel", new Instantiator<EventChannel, Channel>);
#if defined(POCO_OS_FAMILY_UNIX)
#ifndef POCO_NO_SYSLOGCHANNEL