From: Piotr Bartosiewicz
Date: Tue, 11 Mar 2014 10:30:47 +0000 (+0100)
Subject: More log levels
X-Git-Tag: submit/tizen/20140723.154014~95
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16c27b645171e17a97c134e6d56e3ae63ac58b4c;p=platform%2Fcore%2Fsecurity%2Fvasum.git
More log levels
[Issue#] N/A
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests, see output
Change-Id: Icc89e8ad6cc6e191c6266524056269befdd1a968
---
diff --git a/src/server/include/scs-log.hpp b/src/server/include/scs-log.hpp
index a6b4dfc..99e7040 100644
--- a/src/server/include/scs-log.hpp
+++ b/src/server/include/scs-log.hpp
@@ -27,14 +27,19 @@
#define SECURITY_CONTAINERS_SERVER_LOG_HPP
#include
+#include
-#define LOGE(...) std::cerr << "[DS] " << __FILE__ << ":" << __LINE__ << " " \
- << __VA_ARGS__ << std::endl
+#define BASE_FILE (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
-#define LOGD(...) std::cout << "[DS] " << __FILE__ << ":" << __LINE__ << " " \
- << __VA_ARGS__ << std::endl
+#define LOG_LEVEL(level, ...) \
+ std::cout << "[" << level << "] " << BASE_FILE << ":" << __LINE__ << " " \
+ << __VA_ARGS__ << std::endl
+
+#define LOGE(...) LOG_LEVEL("ERROR", __VA_ARGS__)
+#define LOGW(...) LOG_LEVEL("WARN ", __VA_ARGS__)
+#define LOGI(...) LOG_LEVEL("INFO ", __VA_ARGS__)
+#define LOGD(...) LOG_LEVEL("DEBUG", __VA_ARGS__)
+#define LOGT(...) LOG_LEVEL("TRACE", __VA_ARGS__)
-#define LOGW(...) std::cout << "[DS] " << __FILE__ << ":" << __LINE__ << " " \
- << __VA_ARGS__ << std::endl
#endif // SECURITY_CONTAINERS_SERVER_LOG_HPP