X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FDebugModules.cti;h=9ab80f046fd2f3ad6cf129f6399f9a51461c0dbd;hb=d1d92fb783dc558dcf7bdc34ee933c10e1c8d227;hp=7e650035cc9655cf57a056d77ec42c295574149e;hpb=7231c220a7332754de3d16e4e8aacd5dbd31c501;p=senf.git diff --git a/PPI/DebugModules.cti b/PPI/DebugModules.cti index 7e65003..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 @@ -26,32 +26,35 @@ //#include "DebugModules.ih" // Custom includes -#include "Utils/hexdump.hh" +#include "../Utils/hexdump.hh" #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::ppi::module::debug::LogWriter +// senf::ppi::module::debug::Logger -template -prefix_ senf::ppi::module::debug::LogWriter::LogWriter() -{ - noroute(input); - input.onRequest(&LogWriter::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::LogWriter::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///////////////////////////////////////