summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2017-07-26 09:14:07 +0100
committerFrediano Ziglio <fziglio@redhat.com>2017-07-26 15:35:12 +0100
commitcc1534a3a0f38f55bc912992d067e310c9712981 (patch)
tree930b097afaa0523c9a44edc38aa5ca827e15dc6a
parent6a60c1dcccb95311d4a46a91dbded7e19fec2c95 (diff)
Expand PRINT_LINE macros
This complicated macro was used as an helper for LOG macro which expand PRINT_LINE macro twice. Now that LOG expand PRINT_LINE only once there's no need to have this macro which make logging code more complicated. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
-rw-r--r--common/vdlog.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/vdlog.h b/common/vdlog.h
index b1be391..9f08fc4 100644
--- a/common/vdlog.h
+++ b/common/vdlog.h
@@ -58,10 +58,6 @@ static const VDLogLevel log_level = LOG_DEBUG;
static const VDLogLevel log_level = LOG_INFO;
#endif
-#define PRINT_LINE(type, format, datetime, ms, ...) \
- printf("%lu::%s::%s,%.3d::%s::" format "\n", GetCurrentThreadId(), type, datetime, ms, \
- __FUNCTION__, ## __VA_ARGS__);
-
#define LOG(type, format, ...) do { \
if (type >= log_level && type <= LOG_FATAL) { \
const char *type_as_char[] = { "DEBUG", "INFO", "WARN", "ERROR", "FATAL" }; \
@@ -71,7 +67,10 @@ static const VDLogLevel log_level = LOG_INFO;
_ftime_s(&now); \
localtime_s(&today, &now.time); \
strftime(datetime_str, 20, "%Y-%m-%d %H:%M:%S", &today); \
- VDLog::PRINT_LINE(type_as_char[type], format, datetime_str, now.millitm, ## __VA_ARGS__); \
+ VDLog::printf("%lu::%s::%s,%.3d::%s::" format "\n", \
+ GetCurrentThreadId(), type_as_char[type], \
+ datetime_str, now.millitm, \
+ __FUNCTION__, ## __VA_ARGS__); \
} \
} while(0)