From 9dd913943c6026e5d72b29b79d8e624ff6f51c7e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 7 Jun 2011 13:49:35 +0200 Subject: Fix logging of error messages --- SpiceXPI/src/plugin/debug.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'SpiceXPI') diff --git a/SpiceXPI/src/plugin/debug.h b/SpiceXPI/src/plugin/debug.h index a8428f4..c89e368 100644 --- a/SpiceXPI/src/plugin/debug.h +++ b/SpiceXPI/src/plugin/debug.h @@ -89,33 +89,33 @@ static inline std::string pretty_func_to_func_name(const std::string& f_name) LOG4CPP_LOGGER("spice") -#define LOG(type, message) { \ +#define LOG(func, message) { \ std::ostringstream os; \ os << FUNC_NAME; \ os << ": "; \ os << message; \ - LOG4CPP_DEBUG(logger, os.str().c_str()); \ + func(logger, os.str().c_str()); \ } // Used to log just about everything that might be useful (or not). -#define LOG_TRACE(message) LOG(DEBUG, message) +#define LOG_TRACE(message) LOG(LOG4CPP_DEBUG, message) // Used to log debug information which doesn't inflate the log with useless // and repeated messages. -#define LOG_DEBUG(message) LOG(DEBUG, message) +#define LOG_DEBUG(message) LOG(LOG4CPP_DEBUG, message) // Used to log the program flow. -#define LOG_INFO(message) LOG(INFO, message) +#define LOG_INFO(message) LOG(LOG4CPP_INFO, message) // Used to log errors which are handled by the program. -#define LOG_WARN(message) LOG(WARN, message) +#define LOG_WARN(message) LOG(LOG4CPP_WARN, message) // Used to log errors that can't be handled by the program. -#define LOG_ERROR(message) LOG(ERROR, message) +#define LOG_ERROR(message) LOG(LOG4CPP_ERROR, message) // Used to log errors that can't happen (even if they do!). #define LOG_FATAL(message) { \ - LOG(EMERG, message); \ + LOG(LOG4CPP_EMERG, message); \ ON_PANIC(); \ } -- cgit v1.2.3