summaryrefslogtreecommitdiff
path: root/SpiceXPI
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-06-07 13:49:35 +0200
committerHans de Goede <hdegoede@redhat.com>2011-06-07 13:49:35 +0200
commit9dd913943c6026e5d72b29b79d8e624ff6f51c7e (patch)
treebbb54990477b6c534f8d2e155fbe4b731dcabefb /SpiceXPI
parent14850c88258d2567bcad857fff7410274f8e0e5c (diff)
Fix logging of error messages
Diffstat (limited to 'SpiceXPI')
-rw-r--r--SpiceXPI/src/plugin/debug.h16
1 files changed, 8 insertions, 8 deletions
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(); \
}