[Spice-commits] SpiceXPI/src
Hans de Goede
jwrdegoede at kemper.freedesktop.org
Tue Jun 7 04:50:23 PDT 2011
SpiceXPI/src/plugin/debug.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 9dd913943c6026e5d72b29b79d8e624ff6f51c7e
Author: Hans de Goede <hdegoede at redhat.com>
Date: Tue Jun 7 13:49:35 2011 +0200
Fix logging of error messages
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(); \
}
More information about the Spice-commits
mailing list