Bugzilla – Bug 79
Nicer logging of parameters
Last modified: 2007-11-15 00:59:59 UTC
I have a patch that adds a NS_LOG_PARAMS (p1 << p2 << p3 ...) macro, which automatically adds __PRETTY_FUNCTION__ ( and ) around, and also adds the ", " delimiters between parameters.
Created attachment 67 [details] patch
Created attachment 68 [details] patch v2 This patch replaces all NS_LOG_PARAM calls with NS_LOG_PARAMS. OK to commit?
+1
Created attachment 69 [details] patch, v3 This patch builds on the previous version and adds support for logging named parameters, like this: NS_LOG_PARAMS_BEGIN (); NS_LOG_PARAM (this); NS_LOG_PARAM (daddr); NS_LOG_PARAM (dport); NS_LOG_PARAM (saddr); NS_LOG_PARAM (sport); NS_LOG_PARAM (incomingInterface); NS_LOG_PARAMS_END (); Which prints something like: std::list<ns3::Ipv4EndPoint*, std::allocator<ns3::Ipv4EndPoint*> > ns3::Ipv4EndPointDemux::Lookup(ns3::Ipv4Address, uint16_t, ns3::Ipv4Address, uint16_t, ns3::Ptr<ns3::Ipv4Interface>) (this=0x60d3c0, daddr=10.1.2.1, dport=9, saddr=10.1.3.2, sport=49153, incomingInterface=0x60fbe0)
Created attachment 86 [details] patch v3.1 (just updated)
applied as changeset 1828