X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ftbm_log.c;h=7b104e30ff12f6cf8e4dba54f1d247db071ecbfd;hb=f4b39afde43752e437d10d96623701ddb88423c7;hp=e4fcd22b43321a945a71d57b15b398d2a29dc9b7;hpb=24f1cd4d6464b189e5116bd8562151fdce5cd546;p=platform%2Fcore%2Fuifw%2Flibtbm.git diff --git a/src/tbm_log.c b/src/tbm_log.c index e4fcd22..7b104e3 100644 --- a/src/tbm_log.c +++ b/src/tbm_log.c @@ -46,7 +46,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #undef LOG_TAG #define LOG_TAG "TBM" +#if ENABLE_DLOG +#include static unsigned int dlog_enable = 1; +#else +#include +static unsigned int dlog_enable = 0; +#endif static unsigned int color_enable = 1; static unsigned int assert_level = TBM_LOG_LEVEL_NONE; @@ -67,22 +73,10 @@ tbm_log_enable_color(unsigned int enable) void tbm_log_enable_dlog(unsigned int enable) { - const char *str = getenv("TBM_DLOG"); - if (str) - enable = (str[0] == '1') ? 1 : 0; dlog_enable = enable; } void -tbm_log_enable_debug(unsigned int enable) -{ - if (enable) - tbm_log_debug_level = TBM_LOG_LEVEL_DBG; - else - tbm_log_debug_level = TBM_LOG_LEVEL_INFO; -} - -void tbm_log_set_debug_level(int level) { tbm_log_debug_level = level; @@ -172,6 +166,7 @@ tbm_log_print_stdout(int level, const char *fmt, ...) va_end(arg); } +#if ENABLE_DLOG static void _tbm_log_dlog_print(int level, const char *fmt, va_list arg) { @@ -195,6 +190,7 @@ _tbm_log_dlog_print(int level, const char *fmt, va_list arg) } __dlog_vprint(LOG_ID_SYSTEM, dlog_prio, LOG_TAG, fmt, arg); } +#endif void tbm_log_print(int level, const char *fmt, ...) @@ -209,11 +205,15 @@ tbm_log_print(int level, const char *fmt, ...) if (level > tbm_log_debug_level) return; +#if ENABLE_DLOG if (dlog_enable) { va_start(arg, fmt); _tbm_log_dlog_print(level, fmt, arg); va_end(arg); - } else { + } + else +#endif + { va_start(arg, fmt); _tbm_log_vprint_stdout(level, fmt, arg); va_end(arg); @@ -222,9 +222,3 @@ tbm_log_print(int level, const char *fmt, ...) assert(level > assert_level); } -void -tbm_log_reset(void) -{ - pthread_mutex_trylock(&log_lock); - pthread_mutex_unlock(&log_lock); -}