prefix_ senf::ppi::module::debug::Logger<Stream,Area,Level>::Logger()
{}
+template <class Stream, class Area, class Level>
+prefix_ senf::ppi::module::debug::Logger<Stream,Area,Level>::Logger(std::string label)
+ : label_ (label+"\n")
+{}
+
////////////////////////////////////////
// private members
senf::ppi::module::debug::Logger<Stream,Area,Level>::v_handlePacket(Packet const & packet)
{
SENF_LOG_BLOCK_TPL((Stream)(Area)(Level)({
- packet.dump(log);
- hexdump(packet.last().data().begin(), packet.last().data().end(),log);
- }));
+ log << label_;
+ packet.dump(log);
+ hexdump(packet.last().data().begin(), packet.last().data().end(),log);
+ }));
}
///////////////////////////////cti.e///////////////////////////////////////
logTarget.route<senf::log::Debug,senf::log::VERBOSE>();
debug::ActiveFeederSource source;
- debug::Logger<> logger;
+ debug::Logger<> logger ("Prefix text");
ppi::connect(source,logger);
senf::PacketData::byte data[] = { 0x13u, 0x24u, 0x35u };