Print log component list alphabetically.
--- a/RELEASE_NOTES Mon Oct 28 15:04:01 2013 -0700
+++ b/RELEASE_NOTES Mon Oct 28 15:10:24 2013 -0700
@@ -27,6 +27,7 @@
allows to generate a random position uniformly distributed in the
volume of a chosen room inside a chosen building.
- Logging wildcards: allow "***" as synonym for "*=**" to turn on all logging.
+- The log component list ("NS_LOG=print-list") is now printed alphabetically.
Bugs fixed
----------
--- a/src/core/model/log.cc Mon Oct 28 15:04:01 2013 -0700
+++ b/src/core/model/log.cc Mon Oct 28 15:10:24 2013 -0700
@@ -39,8 +39,8 @@
LogTimePrinter g_logTimePrinter = 0;
LogNodePrinter g_logNodePrinter = 0;
-typedef std::list<std::pair <std::string, LogComponent *> > ComponentList;
-typedef std::list<std::pair <std::string, LogComponent *> >::iterator ComponentListI;
+typedef std::map<std::string, LogComponent *> ComponentList;
+typedef std::map<std::string, LogComponent *>::iterator ComponentListI;
static class PrintList
{
@@ -99,7 +99,7 @@
NS_FATAL_ERROR ("Log component \""<<name<<"\" has already been registered once.");
}
}
- components->push_back (std::make_pair (name, this));
+ components->insert (std::make_pair (name, this));
}
void