10x, see below.

Uri Lublin wrote:
On 11/21/2011 09:50 AM, Arnon Gilboa wrote:
-use RHEV log format
-add log levels & macros
-remove LOG_ENABLED ifdefs
---
 common/vdlog.cpp |    4 ----
 common/vdlog.h   |   54 +++++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/common/vdlog.cpp b/common/vdlog.cpp
index 1001de3..8ece384 100644
--- a/common/vdlog.cpp
+++ b/common/vdlog.cp
+enum {
+  LOG_DEBUG,
+  LOG_INFO,
+  LOG_WARN,
+  LOG_ERROR,
+  LOG_FATAL
+};
+ if (log) { \
+        log->PRINT_LINE(type_as_char[type], format, datetime_str, now.millitm, 
## __VA_ARGS__); \
Note that "type" here      ^^^^^^^^^  can be larger than LOG_FATAL.
I think it's better to add a check for that.
not sure it's needed, but i'll add it anyway;)
+#define vd_printf(format, ...) LOG(LOG_INFO, format, ## __VA_ARGS__)
+#define LOG_INFO(format, ...) LOG(LOG_INFO, format, ## __VA_ARGS__)

Nitpick/Style, I don't like using LOG_INFO (and others) for both the
logging operation
and the log level.
consistency with spice client, and i like it;)
+#define LOG_WARN(format, ...) LOG(LOG_WARN, format, ## __VA_ARGS__)
+#define LOG_ERROR(format, ...) LOG(LOG_ERROR, format, ## __VA_ARGS__)

Do you want to add LOG_DEBUG()  or DBG() macros  ?
right, will add

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to