From: Pawel Andruszkiewicz Date: Mon, 23 Nov 2015 09:16:29 +0000 (+0100) Subject: [Common] Disabled debug logs in common module. X-Git-Tag: submit/tizen_mobile/20151215.080542^2~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09e953b5266dfe59f03b84d911ed8a139d261cc2;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Common] Disabled debug logs in common module. [Verification] Code compiles, logic was not affected. Change-Id: I3a453dd290daa27dcafe64f06db4b010273c663c Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/common/common.gyp b/src/common/common.gyp index 43567a3b..0985f9ef 100644 --- a/src/common/common.gyp +++ b/src/common/common.gyp @@ -2,6 +2,9 @@ 'includes':[ '../common/common.gypi', ], + 'variables': { + 'enable_common_debug_logs%': '0', + }, 'targets': [ { 'target_name': 'tizen_common', @@ -84,6 +87,14 @@ }], ], }], + ['extension_build_type == "Debug"', { + 'conditions': [ + ['enable_common_debug_logs == 0', { + # remove TIZEN_DEBUG_ENABLE flag + 'defines!': ['TIZEN_DEBUG_ENABLE'], + }], + ], + }], ], 'direct_dependent_settings': { 'libraries' : [ diff --git a/src/common/logger.h b/src/common/logger.h index 52407247..c30fc909 100644 --- a/src/common/logger.h +++ b/src/common/logger.h @@ -6,6 +6,37 @@ #define COMMON_LOGGER_H_ #include + +// Tizen 3.0 uses different debug flag (DLOG_DEBUG_ENABLE) which is always +// enabled, following code allows to disable logs with DLOG_DEBUG priority if +// TIZEN_DEBUG_ENABLE is not set. +// This code should be removed when DLOG_DEBUG_ENABLE flag is no longer set +// by default in dlog.h file. +#undef LOG_ +#ifdef TIZEN_DEBUG_ENABLE +#define LOG_(id, prio, tag, fmt, arg...) \ + ({ do { \ + __dlog_print(id, prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); \ + } while (0); }) +#else // TIZEN_DEBUG_ENABLE +#define LOG_(id, prio, tag, fmt, arg...) \ + ({ do { \ + if ((int)prio != DLOG_DEBUG) { \ + __dlog_print(id, prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); \ + } \ + } while (0); }) +#endif // TIZEN_DEBUG_ENABLE + +#undef SECURE_LOG_ +#ifdef TIZEN_DEBUG_ENABLE +#define SECURE_LOG_(id, prio, tag, fmt, arg...) \ + ({ do { \ + __dlog_print(id, prio, tag, "%s: %s(%d) > [SECURE_LOG] " fmt, __MODULE__, __func__, __LINE__, ##arg); \ + } while (0); }) +#else // TIZEN_DEBUG_ENABLE +#define SECURE_LOG_(id, prio, tag, fmt, arg...) NOP(fmt, ##arg) +#endif // TIZEN_DEBUG_ENABLE + #include #include #include diff --git a/src/content/content_instance.cc b/src/content/content_instance.cc index bb2a3608..03c4b184 100755 --- a/src/content/content_instance.cc +++ b/src/content/content_instance.cc @@ -18,7 +18,6 @@ #include #include -#include #include #include #include