diff --git a/RELEASE_NOTES b/RELEASE_NOTES index de08875fb..ea44ce2d0 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -29,6 +29,7 @@ New user-visible features Bugs fixed ---------- +- Bug 1552 - Storing log name inside LogComponent class (NS_LOG) as std::string - Bug 1722 - beacons transmitted concurrently - Bug 1616 - WifiPhyStateHelper reports false CCA_BUSY times at State trace source - Bug 1011 - assert failed. file=../src/devices/wifi/dcf-manager.cc diff --git a/src/core/model/log.cc b/src/core/model/log.cc index 2c6601065..5a83e51a4 100644 --- a/src/core/model/log.cc +++ b/src/core/model/log.cc @@ -84,7 +84,7 @@ PrintList::PrintList () } -LogComponent::LogComponent (char const * name) +LogComponent::LogComponent (const std::string & name) : m_levels (0), m_name (name) { EnvVarCheck (name); @@ -103,7 +103,7 @@ LogComponent::LogComponent (char const * name) } void -LogComponent::EnvVarCheck (char const * name) +LogComponent::EnvVarCheck (const std::string & name) { #ifdef HAVE_GETENV char *envVar = getenv ("NS_LOG"); @@ -269,7 +269,7 @@ LogComponent::Disable (enum LogLevel level) char const * LogComponent::Name (void) const { - return m_name; + return m_name.c_str (); } std::string diff --git a/src/core/model/log.h b/src/core/model/log.h index f574b9ca6..e5d198423 100644 --- a/src/core/model/log.h +++ b/src/core/model/log.h @@ -384,8 +384,8 @@ LogNodePrinter LogGetNodePrinter (void); class LogComponent { public: - LogComponent (char const *name); - void EnvVarCheck (char const *name); + LogComponent (const std::string & name); + void EnvVarCheck (const std::string & name); bool IsEnabled (enum LogLevel level) const; bool IsNoneEnabled (void) const; void Enable (enum LogLevel level); @@ -394,7 +394,7 @@ public: std::string GetLevelLabel(const enum LogLevel level) const; private: int32_t m_levels; - char const *m_name; + std::string m_name; }; class ParameterLogger : public std::ostream