diff options
author | 2007-12-31 21:47:15 +0000 | |
---|---|---|
committer | 2007-12-31 21:47:15 +0000 | |
commit | 6d95e48cbd418ee7a49bceeae864c41eba31eeb3 (patch) | |
tree | 62c94909dac2ee3eef1a4184b338220f3003fb1e | |
parent | 0899d2d773d1912790b003127cbe9160836beff9 (diff) | |
download | paludis-6d95e48cbd418ee7a49bceeae864c41eba31eeb3.tar.gz paludis-6d95e48cbd418ee7a49bceeae864c41eba31eeb3.tar.xz |
Make LogLevel use a .se.
-rw-r--r-- | paludis/util/log.cc | 30 | ||||
-rw-r--r-- | paludis/util/log.hh | 30 | ||||
-rw-r--r-- | paludis/util/log.se | 21 |
3 files changed, 22 insertions, 59 deletions
diff --git a/paludis/util/log.cc b/paludis/util/log.cc index 31cbfcb..2f724f9 100644 --- a/paludis/util/log.cc +++ b/paludis/util/log.cc @@ -54,7 +54,7 @@ namespace paludis 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 @@ Log::complete_pending() const _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) { diff --git a/paludis/util/log.hh b/paludis/util/log.hh index 01612c7..43088a5 100644 --- a/paludis/util/log.hh +++ b/paludis/util/log.hh @@ -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 @@ namespace paludis return *this; } }; - - /** - * Stringify a LogLevel constant. - * - * \ingroup g_log - */ - std::ostream & - operator<< (std::ostream &, const LogLevel &) PALUDIS_VISIBLE; } #endif diff --git a/paludis/util/log.se b/paludis/util/log.se index d43a106..9cf3039 100644 --- a/paludis/util/log.se +++ b/paludis/util/log.se @@ -16,3 +16,24 @@ make_enum_LogContext() */ 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 +} + |