[paludis-commits] r4120 - in trunk: . paludis/util

ciaranm at svn.pioto.org ciaranm at svn.pioto.org
Mon Dec 31 21:47:16 UTC 2007


Author: ciaranm
Date: 2007-12-31 21:47:15 +0000 (Mon, 31 Dec 2007)
New Revision: 4120

Modified:
   trunk/ChangeLog
   trunk/paludis/util/log.cc
   trunk/paludis/util/log.hh
   trunk/paludis/util/log.se
Log:
Make LogLevel use a .se.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-12-31 21:15:32 UTC (rev 4119)
+++ trunk/ChangeLog	2007-12-31 21:47:15 UTC (rev 4120)
@@ -5,6 +5,10 @@
 only listed in SVN log. For a summary of what has changed between releases,
 see the NEWS file. This file is occasionally pruned to ChangeLog.old.bz2.
 
+2007-12-31 Ciaran McCreesh
+
+	* paludis/util/: Make LogLevel use a .se.
+
 2007-12-31 David Leverton
 
 	* doc/api/cplusplus/examples/, paludis/,

Modified: trunk/paludis/util/log.cc
===================================================================
--- trunk/paludis/util/log.cc	2007-12-31 21:15:32 UTC (rev 4119)
+++ trunk/paludis/util/log.cc	2007-12-31 21:47:15 UTC (rev 4120)
@@ -54,7 +54,7 @@
         mutable ActionQueue action_queue;
 
         Implementation() :
-            log_level(initial_ll),
+            log_level(ll_qa),
             stream(&std::cerr),
             program_name("paludis"),
             action_queue(1, false, false)
@@ -200,34 +200,6 @@
     _imp->action_queue.complete_pending();
 }
 
-std::ostream &
-paludis::operator<< (std::ostream & s, const LogLevel & l)
-{
-    switch (l)
-    {
-        case ll_qa:
-            s << "qa";
-            return s;
-
-        case ll_warning:
-            s << "warning";
-            return s;
-
-        case ll_debug:
-            s << "debug";
-            return s;
-
-        case ll_silent:
-            s << "silent";
-            return s;
-
-        case last_ll:
-            ;
-    };
-
-    throw InternalError(PALUDIS_HERE, "Bad log level '" + stringify(static_cast<int>(l)) + "'");
-}
-
 void
 Log::set_program_name(const std::string & s)
 {

Modified: trunk/paludis/util/log.hh
===================================================================
--- trunk/paludis/util/log.hh	2007-12-31 21:15:32 UTC (rev 4119)
+++ trunk/paludis/util/log.hh	2007-12-31 21:47:15 UTC (rev 4120)
@@ -38,28 +38,6 @@
 
 namespace paludis
 {
-    /**
-     * Specifies the level of a log message.
-     *
-     * Keep this in order. When deciding whether to display a message, Log
-     * uses message log level >= current log level, so it's important that
-     * least critical levels have lower numeric values.
-     *
-     * When modifying this, you will probably also want to take a look at
-     * ebuild/echo_functions.bash and the command_line source files.
-     *
-     * \ingroup g_log
-     */
-    enum LogLevel
-    {
-        ll_debug,             ///< Debug message
-        ll_qa,                ///< QA messages
-        ll_warning,           ///< Warning message
-        ll_silent,            ///< Silent (for set_log_level)
-        last_ll,              ///< Number of items
-        initial_ll = ll_qa    ///< Initial value
-    };
-
 #include <paludis/util/log-se.hh>
 
     class LogMessageHandler;
@@ -173,14 +151,6 @@
                 return *this;
             }
     };
-
-    /**
-     * Stringify a LogLevel constant.
-     *
-     * \ingroup g_log
-     */
-    std::ostream &
-    operator<< (std::ostream &, const LogLevel &) PALUDIS_VISIBLE;
 }
 
 #endif

Modified: trunk/paludis/util/log.se
===================================================================
--- trunk/paludis/util/log.se	2007-12-31 21:15:32 UTC (rev 4119)
+++ trunk/paludis/util/log.se	2007-12-31 21:47:15 UTC (rev 4120)
@@ -16,3 +16,24 @@
          */
 END
 }
+
+make_enum_LogLevel()
+{
+    prefix ll
+
+    key ll_debug   "Debug"
+    key ll_qa      "QA"
+    key ll_warning "Warning"
+    key ll_silent  "Silent"
+
+    want_destringify
+
+    doxygen_comment << "END"
+        /**
+         * Importance of a log message.
+         *
+         * \ingroup g_log
+         */
+END
+}
+



More information about the paludis-commits mailing list