convert to new debug macros

This commit is contained in:
Mathieu Lacage
2007-02-18 11:19:58 +01:00
parent d7efedefde
commit 715c72fac2
2 changed files with 16 additions and 21 deletions

View File

@@ -24,26 +24,24 @@
#include "ns3/debug.h"
#include "channel.h"
namespace ns3 {
NS_DEBUG_COMPONENT_DEFINE ("Channel");
namespace {
int chDebug = 1;
};
namespace ns3 {
Channel::Channel ()
{
NS3_TRACE(chDebug, "Channel::Channel ()")
NS_DEBUG ("Channel::Channel ()")
}
Channel::~Channel ()
{
NS3_TRACE(chDebug, "Channel::~Channel ()")
NS_DEBUG ("Channel::~Channel ()")
}
bool
Channel::Connect (PhysicalLayer &phys)
{
NS3_TRACE(chDebug, "Channel::Connect (" << &phys << ")")
NS_DEBUG ("Channel::Connect (" << &phys << ")")
m_physList.push_back(static_cast<PhysicalLayer *>(&phys));
return true;
}
@@ -51,7 +49,7 @@ Channel::Connect (PhysicalLayer &phys)
bool
Channel::Propagate (Propagator &propagator)
{
NS3_TRACE(chDebug, "Channel::Propagate (" << &propagator << ")")
NS_DEBUG ("Channel::Propagate (" << &propagator << ")")
for (PhysicalLayerList::const_iterator i = m_physList.begin ();
i != m_physList.end ();

View File

@@ -28,18 +28,15 @@
#include "serial-net-device.h"
#include "serial-channel.h"
NS_DEBUG_COMPONENT_DEFINE ("SerialNetDevice");
namespace ns3 {
const int IPv4ProtocolNumber = 4;
namespace {
int sndDebug = 0;
}
SerialNetDevice::SerialNetDevice(Node* node, const MacAddress& addr) :
NetDevice(node, addr)
{
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::SerialNetDevice (" << node << ", " << &addr << ")")
// BUGBUG FIXME
@@ -53,7 +50,7 @@ SerialNetDevice::SerialNetDevice(Node* node, const MacAddress& addr) :
SerialNetDevice::~SerialNetDevice()
{
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::~SerialNetDevice ()")
}
@@ -61,7 +58,7 @@ SerialNetDevice::~SerialNetDevice()
bool
SerialNetDevice::SendTo (Packet& p, const MacAddress& dest)
{
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::SendTo (" << &p << ", " << &dest << ")")
assert (IsLinkUp ());
@@ -82,7 +79,7 @@ SerialNetDevice::SendTo (Packet& p, const MacAddress& dest)
bool
SerialNetDevice::Attach (SerialChannel* ch)
{
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::Attach (" << &ch << ")")
m_channel = ch;
@@ -101,7 +98,7 @@ SerialNetDevice::Attach (SerialChannel* ch)
void
SerialNetDevice::AddQueue (Queue* q)
{
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::AddQueue (" << q << ")")
m_queue = q;
@@ -111,7 +108,7 @@ void
SerialNetDevice::Receive (Packet& p)
{
// ignore return value for now.
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::Receive (" << &p << ")")
ForwardUp (p);
@@ -120,7 +117,7 @@ SerialNetDevice::Receive (Packet& p)
void
SerialNetDevice::NotifyDataAvailable(void)
{
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::NotifyDataAvailable ()")
Packet p;
@@ -132,7 +129,7 @@ SerialNetDevice::NotifyDataAvailable(void)
p.PeekTag (tag);
// send packet to address tag.address
#endif
NS3_TRACE(sndDebug,
NS_DEBUG (
"SerialNetDevice::NotifyDataAvailable (): Dequeued")
m_channel->Send(p, this);
}