bug 1551 postfix: enable logging for functions outside namespace ns3

This commit is contained in:
Tom Henderson
2014-10-01 20:50:46 -07:00
parent 504c41fa1b
commit c9f4bc4e68
2 changed files with 20 additions and 0 deletions

View File

@@ -569,6 +569,8 @@ Ipv4ClickRouting::NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress
} // namespace ns3
using ns3::g_log;
static int simstrlcpy (char *buf, int len, const std::string &s)
{
if (len)

View File

@@ -165,6 +165,24 @@ void LogComponentDisableAll (enum LogLevel level);
* ns3::LogComponentDisable functions or with the NS_LOG
* environment variable.
*
* This macro should be placed within namespace ns3. If functions
* outside of namespace ns3 require access to logging, the preferred
* solution is to add the following 'using' directive at file scope,
* outside of namespace ns3, and after the inclusion of
* NS_LOG_COMPONENT_DEFINE, such as follows:
* \code
* namespace ns3 {
* NS_LOG_COMPONENT_DEFINE ("...");
*
* \\ definitions within the ns3 namespace
*
* } // namespace ns3
*
* using ns3::g_log;
*
* // further definitions outside of the ns3 namespace
*\endcode
*
* \param name a string
*/
#define NS_LOG_COMPONENT_DEFINE(name) \