X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FDebugModules.cti;h=9ab80f046fd2f3ad6cf129f6399f9a51461c0dbd;hb=164fe477094d42463722584e527a02379ab5d985;hp=b2b2c33847cb7fd471e422e53d90b0424db5a5d6;hpb=a479735a65e334af538b895f182f8efd36a541c5;p=senf.git diff --git a/PPI/DebugModules.cti b/PPI/DebugModules.cti index b2b2c33..9ab80f0 100644 --- a/PPI/DebugModules.cti +++ b/PPI/DebugModules.cti @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -32,26 +32,29 @@ ///////////////////////////////cti.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::ppi::module::debug::LogSink +// senf::ppi::module::debug::Logger -template -prefix_ senf::ppi::module::debug::LogSink::LogSink() -{ - noroute(input); - input.onRequest(&LogSink::request); -} +template +prefix_ senf::ppi::module::debug::Logger::Logger() +{} + +template +prefix_ senf::ppi::module::debug::Logger::Logger(std::string label) + : label_ (label+"\n") +{} //////////////////////////////////////// // private members -template -prefix_ void senf::ppi::module::debug::LogSink::request() +template +prefix_ void +senf::ppi::module::debug::Logger::v_handlePacket(Packet const & packet) { - Packet packet (input()); - SENF_LOG_BLOCK((Stream)(Area)(level)({ - packet.dump(log); - hexdump(packet.last().data().begin(), packet.last().data().end(),log); - })); + SENF_LOG_BLOCK_TPL((Stream)(Area)(Level)({ + log << label_; + packet.dump(log); + hexdump(packet.last().data().begin(), packet.last().data().end(),log); + })); } ///////////////////////////////cti.e///////////////////////////////////////