debug to log

This commit is contained in:
Craig Dowell committed 2007-09-13 21:36:32 -07:00
1 parent 90b02a4f6c
commit 2e1dcf1479
15 files changed
+378 -287

No files matched your search

+17 -26
View File
@@ -20,23 +20,23 @@
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "ns3/debug.h"
#include "ns3/log.h"
#include "ns3/packet.h"
#include "socket.h"
NS_DEBUG_COMPONENT_DEFINE ("Socket");
NS_LOG_COMPONENT_DEFINE ("Socket");
namespace ns3 {
Socket::~Socket ()
{
NS_DEBUG("Socket::~Socket ()");
NS_LOG_FUNCTION;
}
void
Socket::SetCloseCallback (Callback<void,Ptr<Socket> > closeCompleted)
{
NS_DEBUG("Socket::SetCloseCallback ()");
NS_LOG_FUNCTION;
m_closeCompleted = closeCompleted;
}
@@ -46,7 +46,7 @@ Socket::SetConnectCallback (
Callback<void, Ptr<Socket> > connectionFailed,
Callback<void, Ptr<Socket> > halfClose)
{
NS_DEBUG("Socket::SetConnectCallback ()");
NS_LOG_FUNCTION;
m_connectionSucceeded = connectionSucceeded;
m_connectionFailed = connectionFailed;
m_halfClose = halfClose;
@@ -58,7 +58,7 @@ Socket::SetAcceptCallback (
Callback<void, Ptr<Socket>, const Address&> newConnectionCreated,
Callback<void, Ptr<Socket> > closeRequested)
{
NS_DEBUG("Socket::SetAcceptCallback ()");
NS_LOG_FUNCTION;
m_connectionRequest = connectionRequest;
m_newConnectionCreated = newConnectionCreated;
m_closeRequested = closeRequested;
@@ -67,22 +67,21 @@ Socket::SetAcceptCallback (
void
Socket::SetSendCallback (Callback<void, Ptr<Socket>, uint32_t> dataSent)
{
NS_DEBUG("Socket::SetSendCallback ()");
NS_LOG_FUNCTION;
m_dataSent = dataSent;
}
void
Socket::SetRecvCallback (Callback<void, Ptr<Socket>, const Packet &,const Address&> receivedData)
{
NS_DEBUG("Socket::SetRecvCallback ()");
NS_LOG_FUNCTION;
m_receivedData = receivedData;
}
void
Socket::NotifyCloseCompleted (void)
{
NS_DEBUG("Socket::NotifyCloseCompleted ()");
NS_LOG_FUNCTION;
if (!m_closeCompleted.IsNull ())
{
m_closeCompleted (this);
@@ -92,8 +91,7 @@ Socket::NotifyCloseCompleted (void)
void
Socket::NotifyConnectionSucceeded (void)
{
NS_DEBUG("Socket::NotifyConnectionSucceeded ()");
NS_LOG_FUNCTION;
if (!m_connectionSucceeded.IsNull ())
{
m_connectionSucceeded (this);
@@ -103,8 +101,7 @@ Socket::NotifyConnectionSucceeded (void)
void
Socket::NotifyConnectionFailed (void)
{
NS_DEBUG("Socket::NotifyConnectionFailed ()");
NS_LOG_FUNCTION;
if (!m_connectionFailed.IsNull ())
{
m_connectionFailed (this);
@@ -114,8 +111,7 @@ Socket::NotifyConnectionFailed (void)
void
Socket::NotifyHalfClose (void)
{
NS_DEBUG("Socket::NotifyHalfClose ()");
NS_LOG_FUNCTION;
if (!m_halfClose.IsNull ())
{
m_halfClose (this);
@@ -125,8 +121,7 @@ Socket::NotifyHalfClose (void)
bool
Socket::NotifyConnectionRequest (const Address &from)
{
NS_DEBUG("Socket::NotifyConnectionRequest ()");
NS_LOG_FUNCTION;
if (!m_connectionRequest.IsNull ())
{
return m_connectionRequest (this, from);
@@ -141,8 +136,7 @@ Socket::NotifyConnectionRequest (const Address &from)
void
Socket::NotifyNewConnectionCreated (Ptr<Socket> socket, const Address &from)
{
NS_DEBUG("Socket::NotifyNewConnectionCreated ()");
NS_LOG_FUNCTION;
if (!m_newConnectionCreated.IsNull ())
{
m_newConnectionCreated (socket, from);
@@ -152,8 +146,7 @@ Socket::NotifyNewConnectionCreated (Ptr<Socket> socket, const Address &from)
void
Socket::NotifyCloseRequested (void)
{
NS_DEBUG("Socket::NotifyCloseRequested ()");
NS_LOG_FUNCTION;
if (!m_closeRequested.IsNull ())
{
m_closeRequested (this);
@@ -163,8 +156,7 @@ Socket::NotifyCloseRequested (void)
void
Socket::NotifyDataSent (uint32_t size)
{
NS_DEBUG("Socket::NotifyDataSent ()");
NS_LOG_FUNCTION;
if (!m_dataSent.IsNull ())
{
m_dataSent (this, size);
@@ -174,8 +166,7 @@ Socket::NotifyDataSent (uint32_t size)
void
Socket::NotifyDataReceived (const Packet &p, const Address &from)
{
NS_DEBUG("Socket::NotifyDataReceived ()");
NS_LOG_FUNCTION;
if (!m_receivedData.IsNull ())
{
m_receivedData (this, p, from);