[Rivet-svn] r2198 - in trunk: doc include/Rivet/Tools src/Tools

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Dec 18 14:59:07 GMT 2009


Author: buckley
Date: Fri Dec 18 14:59:06 2009
New Revision: 2198

Log:
Various small improvements to logging and doc build

Modified:
   trunk/doc/Makefile.am
   trunk/include/Rivet/Tools/Logging.hh
   trunk/src/Tools/Logging.cc

Modified: trunk/doc/Makefile.am
==============================================================================
--- trunk/doc/Makefile.am	Thu Dec 17 14:37:26 2009	(r2197)
+++ trunk/doc/Makefile.am	Fri Dec 18 14:59:06 2009	(r2198)
@@ -56,7 +56,7 @@
 	$(LATEX) $<; true
 	egrep $(MAKEIDX) $< && ($(MAKEINDEX) $(DOCNAME) && cp $(DOCNAME).toc $(DOCNAME).toc.bak && $(LATEX) $<) > /dev/null; true
 	egrep -c $(RERUNBIB) $(DOCNAME).log && ($(BIBTEX) $(DOCNAME) && cp $(DOCNAME).toc $(DOCNAME).toc.bak && $(LATEX) $<); true
-	while true; do if egrep $(RERUN) $(DOCNAME).log; then cp $(DOCNAME).toc $(DOCNAME).toc.bak && $(LATEX) $<; else break; fi; done; true
+	for i in `seq 5`; do if egrep $(RERUN) $(DOCNAME).log; then cp $(DOCNAME).toc $(DOCNAME).toc.bak && $(LATEX) $<; else break; fi; done; true
 	if cmp -s $(DOCNAME).toc $(DOCNAME).toc.bak; then true; else $(LATEX) $<; true; fi
 	$(RM) $(DOCNAME).toc.bak; true
 

Modified: trunk/include/Rivet/Tools/Logging.hh
==============================================================================
--- trunk/include/Rivet/Tools/Logging.hh	Thu Dec 17 14:37:26 2009	(r2197)
+++ trunk/include/Rivet/Tools/Logging.hh	Fri Dec 18 14:59:06 2009	(r2198)
@@ -15,10 +15,10 @@
     };
 
     /// Typedef for a collection of named logs.
-    typedef std::map<const std::string, Log*> LogMap;
+    typedef std::map<std::string, Log*> LogMap;
 
     /// Typedef for a collection of named log levels.
-    typedef std::map<const std::string, int> LevelMap;
+    typedef std::map<std::string, int> LevelMap;
 
     /// Typedef for a collection of shell color codes, accessed by log level.
     typedef std::map<int, std::string> ColorCodes;
@@ -51,43 +51,41 @@
   public:
     /// Set the log levels
     static void setLevel(const std::string& name, int level);
-    static void setLevels(LevelMap& logLevels);
+    static void setLevels(const LevelMap& logLevels);
 
-    static void setShowTimestamp(const bool showTime=true) {
+    static void setShowTimestamp(bool showTime=true) {
       showTimestamp = showTime;
     }
 
-    static void setShowLevel(const bool showLevel=true) {
+    static void setShowLevel(bool showLevel=true) {
       showLogLevel = showLevel;
     }
 
-    static void setShowLoggerName(const bool showName=true) {
+    static void setShowLoggerName(bool showName=true) {
       showLoggerName = showName;
     }
 
-    static void setUseColors(const bool useColors=true) {
+    static void setUseColors(bool useColors=true) {
       useShellColors = useColors;
     }
 
   protected:
+
     /// @name Hidden constructors etc.
     //@{
+
     /// Constructor 1
     Log(const std::string& name);
 
     /// Constructor 2
     Log(const std::string& name, int level);
 
-    /// Copy constructor
-    //Log(const Log&);
-
-    /// Copy assignment operator
-    //Log& operator=(const Log&);
     //@}
 
     static std::string getColorCode(int level);
 
   public:
+
     /// Get a logger with the given name. The level will be taken from the
     /// "requestedLevels" static map or will be INFO by default.
     static Log& getLog(const std::string& name);

Modified: trunk/src/Tools/Logging.cc
==============================================================================
--- trunk/src/Tools/Logging.cc	Thu Dec 17 14:37:26 2009	(r2197)
+++ trunk/src/Tools/Logging.cc	Fri Dec 18 14:59:06 2009	(r2198)
@@ -44,7 +44,7 @@
   }
 
 
-  void Log::setLevels(LevelMap& logLevels) {
+  void Log::setLevels(const LevelMap& logLevels) {
     for (LevelMap::const_iterator lev = logLevels.begin(); lev != logLevels.end(); ++lev) {
       defaultLevels[lev->first] = lev->second;
     }


More information about the Rivet-svn mailing list