///////////////////////////////cti.p///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-// senf::ppi::module::debug::LogSink<Stream,Area,level>
+// senf::ppi::module::debug::Logger<Stream,Area,level>
template <class Stream, class Area, class Level>
-prefix_ senf::ppi::module::debug::LogSink<Stream,Area,Level>::LogSink()
-{
- noroute(input);
- input.onRequest(&LogSink::request);
-}
+prefix_ senf::ppi::module::debug::Logger<Stream,Area,Level>::Logger()
+{}
////////////////////////////////////////
// private members
template <class Stream, class Area, class Level>
-prefix_ void senf::ppi::module::debug::LogSink<Stream,Area,Level>::request()
+prefix_ void
+senf::ppi::module::debug::Logger<Stream,Area,Level>::v_handlePacket(Packet const & packet)
{
- Packet packet (input());
SENF_LOG_BLOCK_TPL((Stream)(Area)(Level)({
packet.dump(log);
hexdump(packet.last().data().begin(), packet.last().data().end(),log);
#include <deque>
#include "../Utils/safe_bool.hh"
#include "../Packets/Packets.hh"
-#include "Module.hh"
+#include "MonitorModule.hh"
#include "ActiveFeeder.hh"
#include "../Utils/Logger/SenfLog.hh"
template < class Stream = log::Debug,
class Area = log::DefaultArea,
class Level = log::VERBOSE >
- class LogSink
- : public module::Module
+ class Logger
+ : public MonitorModule<>
{
- SENF_PPI_MODULE(LogSink);
+ SENF_PPI_MODULE(Logger);
public:
-
- connector::PassiveInput<> input;
-
- LogSink();
+ Logger();
private:
- void request();
+ virtual void v_handlePacket(Packet const & packet);
};
}}}}
logTarget.route<senf::log::Debug,senf::log::VERBOSE>();
debug::ActiveFeederSource source;
- debug::LogSink<> sink;
+ debug::Logger<> logger;
- ppi::connect(source,sink);
+ ppi::connect(source,logger);
senf::PacketData::byte data[] = { 0x13u, 0x24u, 0x35u };
source.submit( senf::DataPacket::create(data) );
senf::ppi::run();