]> Dogcows Code - chaz/yoink/blobdiff - src/moof/log.hh
remove some unused stlplus modules
[chaz/yoink] / src / moof / log.hh
index cad63e939a572a7c058aa6ad2e5c51fe12c19441..addf37c135f9066025c019aa7818ef16b93851d4 100644 (file)
@@ -1,22 +1,20 @@
 
-/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
+/*]  Copyright (c) 2009-2011, Charles McGarvey  [*****************************
 **]  All rights reserved.
 *
-* vi:ts=4 sw=4 tw=75
-*
 * Distributable under the terms and conditions of the 2-clause BSD license;
 * see the file COPYING for a complete text of the license.
 *
-**************************************************************************/
+*****************************************************************************/
 
 #ifndef _MOOF_LOG_HH_
 #define _MOOF_LOG_HH_
 
 /**
  * \file log.hh
- * Functions related to logging the process.
- * The logging functions are log_error(), log_warning(), and log_info(),
- * listed from most critical to least critical.
+ * Functions related to logging the process.  The logging functions are
+ * log_error(), log_warning(), and log_info(), listed from most critical to
+ * least critical.
  */
 
 #include <cstdlib>             // exit
@@ -27,9 +25,9 @@
 namespace moof {
 
 
+// forward declarations
 class script;
 
-
 /**
  * A class for handling a log priority.  There are two ways to log
  * messages: by treating a log object as a function whose parameters are
@@ -46,14 +44,13 @@ public:
         */
        enum level
        {
-               none            = 0,            ///< Disable all logging.
-               error           = 1,            ///< Log only errors.
-               warning         = 2,            ///< Log warnings and errors.
-               info            = 3,            ///< Log everything.
-               debug           = 4,            ///< Log absolutely everything.
+               none            = 0,    ///< Disable all logging.
+               error           = 1,    ///< Log only errors.
+               warning         = 2,    ///< Log warnings and errors.
+               info            = 3,    ///< Log everything.
+               debug           = 4,    ///< Log absolutely everything.
        };
 
-
        /**
         * Set the lowest-priority log message that will be outputted to the
         * log.  Any logging with a lower priority will be ignored.
@@ -68,14 +65,12 @@ public:
         */
        static enum level level();
 
-
        /**
         * Import log functions to a script.
         * \param The script.
         */
        static void import(script& script);
 
-
        /**
         * Construct a log with a certain priority and prefix string.
         * \param level The log level.
@@ -83,7 +78,6 @@ public:
         */
        log(enum level level);
 
-
        /**
         * Output this to end a line.  This is equivalent to std::endl except
         * this will also reset terminal format attributes.
@@ -92,7 +86,6 @@ public:
        {
        } endl;
 
-
        template <class A>
        void operator () (const A& a)
        {
@@ -119,19 +112,15 @@ public:
 
        template <class A, class B, class C, class D, class E>
        void operator () (const A& a,
-                                         const B& b,
-                                         const C& c,
-                                         const D& d,
-                                         const E& e)
+                       const B& b,
+                       const C& c,
+                       const D& d,
+                       const E& e)
        {
-               *this << a << " "
-                         << b << " "
-                         << c << " "
-                         << d << " "
-                         << e << endl;
+               *this << a << " " << b << " " << c << " " << d << " " << e <<
+                       endl;
        }
 
-
 private:
 
        template <class T> friend std::ostream& operator << (log&, const T&);
@@ -139,11 +128,10 @@ private:
 
        static enum level       global_level_;
 
-       enum level                      level_;
-       std::string                     prefix_;
+       enum level              level_;
+       std::string             prefix_;
 };
 
-
 extern std::ostream&   log;
 extern std::ostream&   null_log;
 
This page took 0.020911 seconds and 4 git commands to generate.