wifi: Cleanup copy-pasted macros for logging

This commit is contained in:
Sébastien Deronne
2024-03-05 21:10:32 +01:00
committed by Sébastien Deronne
parent 24e5bbe67d
commit 3f5d421fe7
10 changed files with 17 additions and 16 deletions

View File

@@ -31,7 +31,7 @@
#include "ns3/wifi-net-device.h"
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
namespace ns3
{

View File

@@ -29,7 +29,7 @@
#include "ns3/log.h"
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
// Time (in nanoseconds) to be added to the PSDU duration to yield the duration
// of the timer that is started when the PHY indicates the start of the reception

View File

@@ -37,6 +37,9 @@
#include "ns3/object.h"
#define WIFI_FEM_NS_LOG_APPEND_CONTEXT \
std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
namespace ns3
{

View File

@@ -37,7 +37,7 @@
#include <functional>
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
namespace ns3
{

View File

@@ -35,7 +35,7 @@
#include <optional>
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
namespace ns3
{

View File

@@ -27,7 +27,7 @@
#include "ns3/log.h"
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
namespace ns3
{

View File

@@ -42,11 +42,7 @@
#include "ns3/simulator.h"
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT \
if (m_mac) \
{ \
std::clog << "[mac=" << m_mac->GetAddress() << "] "; \
}
#define NS_LOG_APPEND_CONTEXT WIFI_TXOP_NS_LOG_APPEND_CONTEXT
namespace ns3
{

View File

@@ -34,11 +34,7 @@
#include "ns3/socket.h"
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT \
if (m_mac) \
{ \
std::clog << "[mac=" << m_mac->GetAddress() << "] "; \
}
#define NS_LOG_APPEND_CONTEXT WIFI_TXOP_NS_LOG_APPEND_CONTEXT
namespace ns3
{

View File

@@ -30,6 +30,12 @@
#include <memory>
#include <vector>
#define WIFI_TXOP_NS_LOG_APPEND_CONTEXT \
if (m_mac) \
{ \
std::clog << "[mac=" << m_mac->GetAddress() << "] "; \
}
class EmlsrUlTxopTest;
namespace ns3

View File

@@ -23,7 +23,7 @@
#include "ns3/log.h"
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[link=" << +m_linkId << "][mac=" << m_self << "] "
#define NS_LOG_APPEND_CONTEXT WIFI_FEM_NS_LOG_APPEND_CONTEXT
namespace ns3
{