Print log component list alphabetically.
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Mon, 28 Oct 2013 15:10:24 -0700
changeset 10230 cb1431abab4a
parent 10229 4da5979086e8
child 10231 60b0d4d40fb9
Print log component list alphabetically.
RELEASE_NOTES
src/core/model/log.cc
--- 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