change dlog output format and dlog platform logging ctrl
authorjuho <juho80.son@samsung.com>
Wed, 5 Dec 2012 09:12:03 +0000 (18:12 +0900)
committerjuho <juho80.son@samsung.com>
Wed, 5 Dec 2012 09:19:17 +0000 (18:19 +0900)
Change-Id: I6f1d6f4d86ef5540e2df4487f45a04157f982d57

.debuglevel [deleted file]
.dloglevel [new file with mode: 0644]
Makefile.am
dlogctrl [new file with mode: 0755]
dlogutil.manifest
include/dlog.h
log.c
logutil.c
packaging/dlog.spec
tizen_platform_env.sh [new file with mode: 0755]

diff --git a/.debuglevel b/.debuglevel
deleted file mode 100755 (executable)
index 6ec88ea..0000000
+++ /dev/null
@@ -1 +0,0 @@
-export TIZEN_DEBUG_LEVEL=1 #
diff --git a/.dloglevel b/.dloglevel
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
index 65bd8b8..2e82e56 100755 (executable)
@@ -14,7 +14,7 @@ libdlog_la_SOURCES =  \
        log.c \
        include/dlog.h
 
-libdlog_la_LIBADD = -lpthread
+libdlog_la_LIBADD = -lpthread -lsystemd-journal
 
 bin_PROGRAMS= dlogutil
 
diff --git a/dlogctrl b/dlogctrl
new file mode 100755 (executable)
index 0000000..840bd45
--- /dev/null
+++ b/dlogctrl
@@ -0,0 +1,59 @@
+#!/bin/sh
+MODE=none
+OBJ=none
+VAL=none
+#echo "tizen_platform_logging_ctrl"
+case "$1" in
+get)
+       MODE=get
+;;
+set)
+       MODE=set
+;;
+
+*)
+echo "Usage: tplctrl {get|set} {platformlog} {1|0}"
+exit 1
+esac
+
+case "$2" in
+platformlog)
+       OBJ=platformlog
+;;
+*)
+       echo "Usage: tplctrl {get|set} {platformlog} {1|0}"
+exit 1
+esac
+
+if [ "$MODE" = "set" ]; then
+       case "$3" in
+       1)
+               VAL=1
+       ;;
+       0)
+               VAL=0
+       ;;
+       *)
+               echo "Usage: tplctrl {get|set} {platformlog} {1|0}"
+       exit 1
+       esac
+fi
+
+if [ "$MODE" = "set" ]; then
+       if [ "$OBJ" = "platformlog" ] && [ "$VAL" = "1" ] ; then
+               touch /opt/etc/dlog/.platformloggingmode 2>/dev/null
+       elif [ "$OBJ" = "platformlog" ] && [ "$VAL" = "0" ] ; then
+               rm -f /opt/etc/dlog/.platformloggingmode 2>/dev/null
+       fi
+else
+       if [ "$OBJ" = "platformlog" ]; then
+               if [ -e "/opt/etc/dlog/.platformloggingmode" ]; then
+                       echo 1
+               else
+                       echo 0
+               fi
+       fi
+
+fi
+
+exit 0
index 6eaf29b..2eecb07 100644 (file)
@@ -1,11 +1,15 @@
 <manifest>
-<define>
-<domain name="dlogutil" policy="restricted"/>
-</define>
-<request>
-<domain name="dlogutil"/>
-</request>
-<assign>
-<filesystem path="/usr/bin/dlogutil" label="dlogutil"/>
-</assign>
+       <define>
+               <domain name="dlogutil" policy="restricted"/>
+       <provide>
+               <label name="dlogutil::dlog"/>
+       </provide>
+       </define>
+       <request>
+               <domain name="dlogutil"/>
+       </request>
+       <assign>
+               <filesystem path="/usr/bin/dlogutil" label="dlogutil"/>
+               <filesystem path="/opt/etc/dlog" label="dlogutil::dlog"/>
+       </assign>
 </manifest>
index 9a9f69e..b29c25f 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-/** 
+/**
  * @file       dlog.h
  * @version    0.4
  * @brief      This file is the header file of interface of dlog.
  */
-
-
 /**
  * @addtogroup APPLICATION_FRAMEWORK
  * @{
@@ -31,8 +27,6 @@
  * @{
 
  */
-
-
 #ifndef        _DLOG_H_
 #define        _DLOG_H_
 
@@ -62,6 +56,11 @@ extern "C" {
 #define LOG_TAG NULL
 #endif
 
+#define LOG_ON() _get_logging_on()
+
+#ifndef __MODULE__
+#define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+#endif
 /*
  * log priority values, in ascending priority order.
  */
@@ -79,16 +78,15 @@ typedef enum {
 
 typedef enum {
     LOG_ID_MAIN = 0,
-    LOG_ID_RADIO,
-    LOG_ID_SYSTEM,
-    LOG_ID_APPS,
-    LOG_ID_MAX
+       LOG_ID_RADIO,
+       LOG_ID_SYSTEM,
+       LOG_ID_APPS,
+       LOG_ID_MAX
 } log_id_t;
 
-#define CONDITION(cond)     (__builtin_expect((cond)!=0, 0))
+#define CONDITION(cond)     (__builtin_expect((cond) != 0, 0))
 
 // ---------------------------------------------------------------------
-
 /**
  * Simplified macro to send a verbose log message using the current LOG_TAG.
  */
@@ -96,11 +94,10 @@ typedef enum {
 #if LOG_NDEBUG
 #define LOGV(...)   ((void)0)
 #else
-#define LOGV(...) ((void)LOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
-
+#define LOGV(format, arg...) \
+       (LOG_ON() ? (LOG(LOG_VERBOSE, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 #endif
-
 /**
  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
  */
@@ -109,268 +106,296 @@ typedef enum {
 #define LOGV_IF(cond, ...)   ((void)0)
 #else
 #define LOGV_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (LOG(LOG_VERBOSE, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 #endif
-
 /**
  * Simplified macro to send a debug log message using the current LOG_TAG.
  */
 #ifndef LOGD
-#define LOGD(...) ((void)LOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#define LOGD(format, arg...) \
+       (LOG_ON() ? (LOG(LOG_DEBUG, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional debug log message using the current LOG_TAG.
+ * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef LOGD_IF
 #define LOGD_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (LOG(LOG_DEBUG, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 
 /**
  * Simplified macro to send an info log message using the current LOG_TAG.
  */
 #ifndef LOGI
-#define LOGI(...) ((void)LOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
+#define LOGI(format, arg...) \
+       (LOG_ON() ? (LOG(LOG_INFO, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional info log message using the current LOG_TAG.
+ * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef LOGI_IF
 #define LOGI_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (LOG(LOG_INFO, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 
 /**
  * Simplified macro to send a warning log message using the current LOG_TAG.
  */
 #ifndef LOGW
-#define LOGW(...) ((void)LOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
+#define LOGW(format, arg...) \
+       (LOG_ON() ? (LOG(LOG_WARN, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional warning log message using the current LOG_TAG.
+ * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef LOGW_IF
 #define LOGW_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (LOG(LOG_WARN, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 
 /**
  * Simplified macro to send an error log message using the current LOG_TAG.
  */
 #ifndef LOGE
-#define LOGE(...) ((void)LOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#define LOGE(format, arg...) \
+       (LOG_ON() ? (LOG(LOG_ERROR, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional error log message using the current LOG_TAG.
+ * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef LOGE_IF
 #define LOGE_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (LOG(LOG_ERROR, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
+#endif
+/**
+ * Simplified macro to send an error log message using the current LOG_TAG.
+ */
+#ifndef LOGF
+#define LOGF(format, arg...) \
+       (LOG_ON() ? (LOG(LOG_FATAL, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
+#endif
+/**
+ * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
+ */
+#ifndef LOGF_IF
+#define LOGF_IF(cond, ...) \
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (LOG(LOG_FATAL, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 
 // ---------------------------------------------------------------------
-
 /**
- * Simplified macro to send a verbose radio log message using the current LOG_TAG.
+ * Simplified radio macro to send a verbose log message using the current LOG_TAG.
  */
 #ifndef RLOGV
 #if LOG_NDEBUG
 #define RLOGV(...)   ((void)0)
 #else
-#define RLOGV(...) ((void)RLOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#define RLOGV(format, arg...) \
+       (LOG_ON() ? (RLOG(LOG_VERBOSE, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 #endif
-       
 /**
- * Simplified macro to send a conditional verbose radio log message using the current LOG_TAG.
- */    
+ * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
+ */
 #ifndef RLOGV_IF
 #if LOG_NDEBUG
 #define RLOGV_IF(cond, ...)   ((void)0)
 #else
 #define RLOGV_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)RLOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (RLOG(LOG_VERBOSE, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 #endif
-       
+
 /**
- * Simplified macro to send a debug radio log message using the current LOG_TAG.
+ * Simplified radio macro to send a debug log message using the current LOG_TAG.
  */
 #ifndef RLOGD
-#define RLOGD(...) ((void)RLOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#define RLOGD(format, arg...) \
+       (LOG_ON() ? (RLOG(LOG_DEBUG, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional debug radio log message using the current LOG_TAG.
- */    
+ * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
+ */
 #ifndef RLOGD_IF
 #define RLOGD_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)RLOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (RLOG(LOG_DEBUG, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-       
+
 /**
- * Simplified macro to send an info radio log message using the current LOG_TAG.
+ * Simplified radio macro to send an info log message using the current LOG_TAG.
  */
 #ifndef RLOGI
-#define RLOGI(...) ((void)RLOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
+#define RLOGI(format, arg...) \
+       (LOG_ON() ? (RLOG(LOG_INFO, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional info radio log message using the current LOG_TAG.
+ * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef RLOGI_IF
 #define RLOGI_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)RLOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (RLOG(LOG_INFO, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-       
+
 /**
- * Simplified macro to send a warning radio log message using the current LOG_TAG.
+ * Simplified radio macro to send a warning log message using the current LOG_TAG.
  */
 #ifndef RLOGW
-#define RLOGW(...) ((void)RLOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
+#define RLOGW(format, arg...) \
+       (LOG_ON() ? (RLOG(LOG_WARN, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional warning radio log message using the current LOG_TAG.
+ * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef RLOGW_IF
 #define RLOGW_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)RLOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (RLOG(LOG_WARN, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-       
+
 /**
- * Simplified macro to send an error radio log message using the current LOG_TAG.
+ * Simplified radio macro to send an error log message using the current LOG_TAG.
  */
 #ifndef RLOGE
-#define RLOGE(...) ((void)RLOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#define RLOGE(format, arg...) \
+       (LOG_ON() ? (RLOG(LOG_ERROR, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional error radio log message using the current LOG_TAG.
- */    
+ * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
+ */
 #ifndef RLOGE_IF
 #define RLOGE_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)RLOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (RLOG(LOG_ERROR, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
+#endif
+/**
+ * Simplified radio macro to send an error log message using the current LOG_TAG.
+ */
+#ifndef RLOGF
+#define RLOGF(format, arg...) \
+       (LOG_ON() ? (RLOG(LOG_FATAL, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
+#endif
+/**
+ * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
+ */
+#ifndef RLOGF_IF
+#define RLOGF_IF(cond, ...) \
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (RLOG(LOG_FATAL, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 
-// ---------------------------------------------------------------------
 
+// ---------------------------------------------------------------------
 /**
- * Simplified macro to send a verbose system log message using the current LOG_TAG.
+ * Simplified system macro to send a verbose log message using the current LOG_TAG.
  */
 #ifndef SLOGV
 #if LOG_NDEBUG
 #define SLOGV(...)   ((void)0)
 #else
-#define SLOGV(...) ((void)SLOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#define SLOGV(format, arg...) \
+       (LOG_ON() ? (SLOG(LOG_VERBOSE, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 #endif
-
 /**
- * Simplified macro to send a conditional verbose system log message using the current LOG_TAG.
+ * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef SLOGV_IF
 #if LOG_NDEBUG
 #define SLOGV_IF(cond, ...)   ((void)0)
 #else
 #define SLOGV_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)SLOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (SLOG(LOG_VERBOSE, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 #endif
-       
+
 /**
- * Simplified macro to send a debug system log message using the current LOG_TAG.
+ * Simplified system macro to send a debug log message using the current LOG_TAG.
  */
 #ifndef SLOGD
-#define SLOGD(...) ((void)SLOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#define SLOGD(format, arg...) \
+       (LOG_ON() ? (SLOG(LOG_DEBUG, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional debug system log message using the current LOG_TAG.
+ * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef SLOGD_IF
 #define SLOGD_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)SLOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (SLOG(LOG_DEBUG, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-       
+
 /**
- * Simplified macro to send an info system log message using the current LOG_TAG.
+ * Simplified system macro to send an info log message using the current LOG_TAG.
  */
 #ifndef SLOGI
-#define SLOGI(...) ((void)SLOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
+#define SLOGI(format, arg...) \
+       (LOG_ON() ? (SLOG(LOG_INFO, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional info system log message using the current LOG_TAG.
+ * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef SLOGI_IF
 #define SLOGI_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)SLOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (SLOG(LOG_INFO, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-       
+
 /**
- * Simplified macro to send a warning system log message using the current LOG_TAG.
+ * Simplified system macro to send a warning log message using the current LOG_TAG.
  */
 #ifndef SLOGW
-#define SLOGW(...) ((void)SLOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
+#define SLOGW(format, arg...) \
+       (LOG_ON() ? (SLOG(LOG_WARN, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional warning system log message using the current LOG_TAG.
+ * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef SLOGW_IF
 #define SLOGW_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)SLOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (SLOG(LOG_WARN, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-       
+
 /**
- * Simplified macro to send an error system log message using the current LOG_TAG.
+ * Simplified system macro to send an error log message using the current LOG_TAG.
  */
 #ifndef SLOGE
-#define SLOGE(...) ((void)SLOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#define SLOGE(format, arg...) \
+       (LOG_ON() ? (SLOG(LOG_ERROR, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
-
 /**
- * Simplified macro to send a conditional error system log message using the current LOG_TAG.
+ * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
  */
 #ifndef SLOGE_IF
 #define SLOGE_IF(cond, ...) \
-               ( (CONDITION(cond)) \
-               ? ((void)SLOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
-               : (void)0 )
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (SLOG(LOG_ERROR, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
+#endif
+/**
+ * Simplified system macro to send an error log message using the current LOG_TAG.
+ */
+#ifndef SLOGF
+#define SLOGF(format, arg...) \
+       (LOG_ON() ? (SLOG(LOG_FATAL, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
+#endif
+/**
+ * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
+ */
+#ifndef SLOGF_IF
+#define SLOGF_IF(cond, ...) \
+       (((CONDITION(cond)) && (LOG_ON())) ? \
+         (SLOG(LOG_FATAL, LOG_TAG, "%s:%s(%d)>"format, __MODULE__, __func__, __LINE__, ##arg)) : ((void)0))
 #endif
 
 // ---------------------------------------------------------------------
@@ -383,75 +408,26 @@ typedef enum {
 #define ALOGV(...)   ((void)0)
 #else
 #define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
-
-#endif
-#endif
-
-/**
- * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
- */
-#ifndef ALOGV_IF
-#if LOG_NDEBUG
-#define ALOGV_IF(cond, ...)   ((void)0)
-#else
-#define ALOGV_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
 #endif
 #endif
-
 /**
  * Simplified macro to send a debug log message using the current LOG_TAG.
  */
 #ifndef ALOGD
 #define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
 #endif
-
-/**
- * Simplified macro to send a conditional debug log message using the current LOG_TAG.
- */
-#ifndef ALOGD_IF
-#define ALOGD_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
-#endif
-
 /**
  * Simplified macro to send an info log message using the current LOG_TAG.
  */
 #ifndef ALOGI
 #define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
 #endif
-
-/**
- * Simplified macro to send a conditional info log message using the current LOG_TAG.
- */
-#ifndef ALOGI_IF
-#define ALOGI_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
-#endif
-
 /**
  * Simplified macro to send a warning log message using the current LOG_TAG.
  */
 #ifndef ALOGW
 #define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
 #endif
-
-/**
- * Simplified macro to send a conditional warning log message using the current LOG_TAG.
- */
-#ifndef ALOGW_IF
-#define ALOGW_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
-#endif
-
 /**
  * Simplified macro to send an error log message using the current LOG_TAG.
  */
@@ -459,19 +435,7 @@ typedef enum {
 #define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
 #endif
 
-/**
- * Simplified macro to send a conditional error log message using the current LOG_TAG.
- */
-#ifndef ALOGE_IF
-#define ALOGE_IF(cond, ...) \
-    ( (CONDITION(cond)) \
-    ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
-    : (void)0 )
-#endif
-// TODO : support fatal log
-
 // ---------------------------------------------------------------------
-
 /**
  * Basic log message macro that allows you to specify a priority and a tag
  *
@@ -488,41 +452,19 @@ typedef enum {
 #endif
 
 /**
- * Log macro that allows you to pass in a varargs ("args" is a va_list).
+ * tizen app log macro that allows you to specify a priority and a tag.
  */
-#ifndef LOG_VA
-#define LOG_VA(priority, tag, fmt, args) \
-    vprint_log(D##priority, tag, fmt, args)
-#endif
-
 #ifndef ALOG
 #define ALOG(priority, tag, ...) \
        print_apps_log(D##priority, tag, __VA_ARGS__)
 #endif
 /**
- * Log macro that allows you to pass in a varargs ("args" is a va_list).
- */
-#ifndef ALOG_VA
-#define ALOG_VA(priority, tag, fmt, args) \
-    vprint_apps_log(D##priority, tag, fmt, args)
-#endif
-
-/**
  * Basic radio log macro that allows you to specify a priority and a tag.
  */
 #ifndef RLOG
 #define RLOG(priority, tag, ...) \
        print_radio_log(D##priority, tag, __VA_ARGS__)
 #endif
-
-/**
- * Radio log macro that allows you to pass in a varargs ("args" is a va_list).
- */
-#ifndef RLOG_VA
-#define RLOG_VA(priority, tag, fmt, args) \
-    vprint_radio_log(D##priority, tag, fmt, args)
-#endif
-
 /**
  * Basic system log macro that allows you to specify a priority and a tag.
  */
@@ -531,15 +473,6 @@ typedef enum {
     print_system_log(D##priority, tag, __VA_ARGS__)
 #endif
 
-/**
- * System log macro that allows you to pass in a varargs ("args" is a va_list).
- */
-#ifndef SLOG_VA
-#define SLOG_VA(priority, tag, fmt, args) \
-    vprint_system_log(D##priority, tag, fmt, args)
-#endif
-
-
 /*
  * ===========================================================================
  *
@@ -549,32 +482,20 @@ typedef enum {
 #define print_apps_log(prio, tag, fmt...) \
        __dlog_print(LOG_ID_APPS, prio, tag, fmt)
 
-#define vprint_apps_log(prio, tag, fmt...) \
-       __dlog_vprint(LOG_ID_APPS, prio, tag, fmt)
-
 #define print_log(prio, tag, fmt...) \
        __dlog_print(LOG_ID_MAIN, prio, tag, fmt)
 
-#define vprint_log(prio, tag, fmt...) \
-       __dlog_vprint(LOG_ID_MAIN, prio, tag, fmt)
-       
 #define print_radio_log(prio, tag, fmt...)\
        __dlog_print(LOG_ID_RADIO, prio, tag, fmt)
 
-#define vprint_radio_log(prio, tag, fmt...) \
-       __dlog_vprint(LOG_ID_RADIO, prio, tag, fmt)
-
 #define print_system_log(prio, tag, fmt...)\
        __dlog_print(LOG_ID_SYSTEM, prio, tag, fmt)
 
-#define vprint_system_log(prio, tag, fmt...) \
-       __dlog_vprint(LOG_ID_SYSTEM, prio, tag, fmt)
-
 /**
  * @brief              send log. must specify log_id ,priority, tag and format string.
  * @pre                none
  * @post               none
- * @see                __dlog_vprint
+ * @see                __dlog_print
  * @remarks    you must not use this API directly. use macros instead.
  * @param[in]  log_id  log device id
  * @param[in]  prio    priority
@@ -592,30 +513,8 @@ typedef enum {
  * @endcode
  */
 int __dlog_print(log_id_t log_id, int prio, const char *tag, const char *fmt, ...);
-
-/**
- * @brief              send log with va_list. must specify log_id ,priority, tag and format string.
- * @pre                none
- * @post               none
- * @see                __dlog_print 
- * @remarks    you must not use this API directly. use macros instead. 
- * @param[in]  log_id  log device id
- * @param[in]  prio    priority
- * @param[in]  tag     tag
- * @param[in]  fmt     format string 
- * @param[in]  ap      va_list 
- * @return                     Operation result
- * @retval             0>=     Success
- * @retval              -1     Error
- * @code
- // you have to use LOG_VA(), SLOG_VA(), RLOG_VA() family not to use __dlog_print() directly
- // so below example is just for passing Documentation Verification !!!
-#define LOG_TAG USR_TAG
-#include<dlog.h>
-  __dlog_vprint(LOG_ID_MAIN, DLOG_INFO, USR_TAG, "you must not use this API directly", ap);
- * @endcode
-  */
 int __dlog_vprint(log_id_t log_id, int prio, const char *tag, const char *fmt, va_list ap);
+int _get_logging_on();
 
 #ifdef __cplusplus
 }
diff --git a/log.c b/log.c
index d7be833..6c5235f 100755 (executable)
--- a/log.c
+++ b/log.c
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #ifdef HAVE_PTHREADS
 #include <pthread.h>
 #endif
@@ -25,7 +24,9 @@
 #include <stdio.h>
 #include <errno.h>
 #include <dlog.h>
-
+#ifdef SD_JOURNAL_LOG
+#include <systemd/sd-journal.h>
+#endif
 #define LOG_BUF_SIZE   1024
 
 #define LOG_MAIN       "log_main"
 #define LOG_SYSTEM     "log_system"
 #define LOG_APPS       "log_apps"
 
-
 static int log_fds[(int)LOG_ID_MAX] = { -1, -1, -1, -1 };
 
-static int g_debug_level= DLOG_SILENT;
+static int g_logging_on = 1;
+static int g_dlog_level = DLOG_SILENT;
 
 static int __dlog_init(log_id_t, log_priority, const char *tag, const char *msg);
 static int (*write_to_log)(log_id_t, log_priority, const char *tag, const char *msg) = __dlog_init;
 #ifdef HAVE_PTHREADS
 static pthread_mutex_t log_init_lock = PTHREAD_MUTEX_INITIALIZER;
 #endif
-
-
 static int __write_to_log_null(log_id_t log_id, log_priority prio, const char *tag, const char *msg)
 {
-    return -1;
+       return -1;
+}
+#ifdef SD_JOURNAL_LOG
+static int dlog_pri_to_journal_pri(log_priority prio)
+{
+       int journal_prio = LOG_DEBUG;
+
+       switch(prio) {
+       case DLOG_UNKNOWN:
+       case DLOG_DEFAULT:
+       case DLOG_VERBOSE:
+               journal_prio = LOG_DEBUG;
+               break;
+       case DLOG_DEBUG:
+               journal_prio = LOG_DEBUG;
+               break;
+       case DLOG_INFO:
+               journal_prio = LOG_INFO;
+               break;
+       case DLOG_WARN:
+               journal_prio = LOG_WARNING;
+               break;
+       case DLOG_ERROR:
+               journal_prio = LOG_ERR;
+               break;
+       case DLOG_FATAL:
+               journal_prio = LOG_CRIT;
+               break;
+       case DLOG_SILENT:
+       default:
+               journal_prio = -1;
+               break;
+       }
+       return journal_prio;
 }
-
+static int __write_to_log_kernel(log_id_t log_id, log_priority prio, const char *tag, const char *msg)
+{
+       sd_journal_print(dlog_pri_to_journal_pri(prio), "%s %s", tag, msg);
+       return 1;
+}
+#else
 static int __write_to_log_kernel(log_id_t log_id, log_priority prio, const char *tag, const char *msg)
 {
        ssize_t ret;
@@ -57,19 +94,19 @@ static int __write_to_log_kernel(log_id_t log_id, log_priority prio, const char
        struct iovec vec[3];
 
        if (log_id < LOG_ID_APPS) {
-               if(prio<g_debug_level) {
+               if(prio < g_dlog_level) {
                        return 0;
                }
        } else if (LOG_ID_MAX <= log_id) {
                return 0;
        }
-       if( log_id < LOG_ID_MAX )
+       if (log_id < LOG_ID_MAX)
                log_fd = log_fds[log_id];
        else
                return -1; // for TC
 
        if (!tag)
-                 tag = "";
+               tag = "";
 
        vec[0].iov_base = (unsigned char *) &prio;
        vec[0].iov_len  = 1;
@@ -82,80 +119,86 @@ static int __write_to_log_kernel(log_id_t log_id, log_priority prio, const char
 
        return ret;
 }
-
-void init_debug_level(void)
-{
-       char *debuglevel=getenv("TIZEN_DEBUG_LEVEL");
-       if(!debuglevel) {
-#ifndef NDEBUG
-               fprintf(stderr, "Not matched env. variable, TIZEN_DEBUG_LEVEL");
 #endif
-               return;
+void init_dlog_level(void)
+{
+       char *dlog_level;
+       char *logging_mode;
+       if (g_logging_on) {
+               logging_mode = getenv("TIZEN_PLATFORMLOGGING_MODE");
+               if (!logging_mode)
+                               g_logging_on = 0;
+                       else
+                               g_logging_on = atoi(logging_mode);
        }
-       g_debug_level=atoi(debuglevel);
-#ifndef NDEBUG
-       fprintf(stderr, "debug level init %d(%s) \n",g_debug_level,debuglevel);
-#endif
+       if (g_logging_on) {
+               dlog_level = getenv("TIZEN_DLOG_LEVEL");
+               if (!dlog_level) {
+                       g_dlog_level = 8;
+               } else {
+                       g_dlog_level = atoi(dlog_level);
+               }
+       } else
+               g_dlog_level = 8;
 }
 static int __dlog_init(log_id_t log_id, log_priority prio, const char *tag, const char *msg)
 {
 #ifdef HAVE_PTHREADS
-               pthread_mutex_lock(&log_init_lock);
+       pthread_mutex_lock(&log_init_lock);
 #endif
        // get filtering info
-
        // open device
-       if( write_to_log == __dlog_init)
-       {
+       if (write_to_log == __dlog_init) {
+#ifdef SD_JOURNAL_LOG
+               write_to_log = __write_to_log_sd_journal_print;
+#else
+               init_dlog_level();
+
                log_fds[LOG_ID_MAIN] = open("/dev/"LOG_MAIN, O_WRONLY);
                log_fds[LOG_ID_RADIO] = open("/dev/"LOG_RADIO, O_WRONLY);
                log_fds[LOG_ID_SYSTEM] = open("/dev/"LOG_SYSTEM, O_WRONLY);
                log_fds[LOG_ID_APPS] = open("/dev/"LOG_APPS, O_WRONLY);
 
-               init_debug_level();
-
-               if( log_fds[LOG_ID_MAIN] < 0 || log_fds[LOG_ID_RADIO] < 0 )
-               {
+               if (log_fds[LOG_ID_MAIN] < 0 || log_fds[LOG_ID_RADIO] < 0) {
                        fprintf(stderr, "open log dev is failed\n");
                        write_to_log = __write_to_log_null;
-               }
-               else
+               } else
                        write_to_log = __write_to_log_kernel;
 
-               if( log_fds[LOG_ID_SYSTEM] < 0 )
-               {
+               if (log_fds[LOG_ID_SYSTEM] < 0)
                        log_fds[LOG_ID_SYSTEM] = log_fds[LOG_ID_MAIN];
-               }
 
-               if( log_fds[LOG_ID_APPS] < 0 )
-               {
+               if (log_fds[LOG_ID_APPS] < 0)
                        log_fds[LOG_ID_APPS] = log_fds[LOG_ID_MAIN];
-               }
+#endif
        }
 #ifdef HAVE_PTHREADS
-    pthread_mutex_unlock(&log_init_lock);
+       pthread_mutex_unlock(&log_init_lock);
 #endif
        return write_to_log(log_id, prio, tag, msg);
 }
 
 int __dlog_vprint(log_id_t log_id, int prio, const char *tag, const char *fmt, va_list ap)
 {
-    char buf[LOG_BUF_SIZE];
+       char buf[LOG_BUF_SIZE];
 
-    vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
+       vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
 
-    return write_to_log(log_id, prio, tag, buf);
+       return write_to_log(log_id, prio, tag, buf);
 }
 
 int __dlog_print(log_id_t log_id, int prio, const char *tag, const char *fmt, ...)
 {
-    va_list ap;
-    char buf[LOG_BUF_SIZE];
+       va_list ap;
+       char buf[LOG_BUF_SIZE];
 
-    va_start(ap, fmt);
-    vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
-    va_end(ap);
+       va_start(ap, fmt);
+       vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
+       va_end(ap);
 
-    return write_to_log(log_id, prio, tag, buf);
+       return write_to_log(log_id, prio, tag, buf);
+}
+int _get_logging_on()
+{
+       return g_logging_on;
 }
-
index 92f2da4..1e91d38 100755 (executable)
--- a/logutil.c
+++ b/logutil.c
@@ -97,7 +97,7 @@ static void enqueue(struct log_device_t* device, struct queued_entry_t* entry)
 
 static int open_logfile (const char *pathname)
 {
-    return open(pathname, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
+    return open(pathname, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 }
 
 static void rotate_logs()
index 7bc6fb9..15426cd 100755 (executable)
@@ -1,4 +1,3 @@
-#sbs-git:slp/pkgs/d/dlog dlog 0.4.0 f2a67c71d044de4757f7eef9759c7f99d527462f
 Name:       dlog
 Summary:    Logging service
 Version:    0.4.0
@@ -8,7 +7,7 @@ License:    Apache License
 Source0:    %{name}-%{version}.tar.gz
 Source101:  packaging/dlog-main.service
 Source102:  packaging/dlog-radio.service
-
+BuildRequires: pkgconfig(systemd)
 Requires(post): /sbin/ldconfig
 Requires(post): /usr/bin/systemctl
 Requires(post): /usr/bin/vconftool
@@ -51,7 +50,6 @@ utilities for print log data
 
 
 %build
-
 %autogen --disable-static
 %configure --disable-static
 make %{?jobs:-j%jobs}
@@ -59,6 +57,12 @@ make %{?jobs:-j%jobs}
 %install
 rm -rf %{buildroot}
 %make_install
+mkdir -p %{buildroot}/opt/etc/
+cp %{_builddir}/%{name}-%{version}/.dloglevel %{buildroot}/opt/etc/.dloglevel
+mkdir -p %{buildroot}/etc/profile.d/
+cp %{_builddir}/%{name}-%{version}/tizen_platform_env.sh %{buildroot}/etc/profile.d/tizen_platform_env.sh
+mkdir -p %{buildroot}/usr/bin/
+cp %{_builddir}/%{name}-%{version}/dlogctrl %{buildroot}/usr/bin/dlogctrl
 
 mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
 mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc5.d
@@ -68,7 +72,6 @@ ln -s ../init.d/dlog.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S05dlog
 ln -s ../init.d/dlog.sh %{buildroot}/%{_sysconfdir}/rc.d/rc5.d/S05dlog
 
 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
-mkdir -p %{buildroot}%{_libdir}/udev/rules.d
 
 install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/
 install -m 0644 %SOURCE102 %{buildroot}%{_libdir}/systemd/system/
@@ -76,8 +79,6 @@ install -m 0644 %SOURCE102 %{buildroot}%{_libdir}/systemd/system/
 ln -s ../dlog-main.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-main.service
 ln -s ../dlog-radio.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-radio.service
 
-mkdir -p %{buildroot}/opt/etc/
-cp %{_builddir}/%{name}-%{version}/.debuglevel %{buildroot}/opt/etc/.debuglevel
 mkdir -p %{buildroot}/usr/share/license
 cp LICENSE %{buildroot}/usr/share/license/%{name}
 
@@ -89,6 +90,10 @@ if [ $1 == 0 ]; then
 fi
 
 %post -n dlogutil
+mkdir -p /opt/etc/dlog
+chown 0:5000 /opt/etc/dlog
+chmod 775 /opt/etc/dlog
+chmod 755 /usr/bin/dlogctrl
 systemctl daemon-reload
 if [ $1 == 1 ]; then
     systemctl restart dlog-main.service
@@ -99,17 +104,14 @@ fi
 systemctl daemon-reload
 
 %post -n libdlog
-chmod +x /opt/etc/.debuglevel
-rm -f /etc/profile.d/dlevel.sh
-ln -s /opt/etc/.debuglevel /etc/profile.d/dlevel.sh
 /sbin/ldconfig
-
 %postun -n libdlog
 /sbin/ldconfig
 
 %files  -n dlogutil
 %manifest dlogutil.manifest
 %{_bindir}/dlogutil
+%{_bindir}/dlogctrl
 %{_sysconfdir}/rc.d/init.d/dlog.sh
 %{_sysconfdir}/rc.d/rc3.d/S05dlog
 %{_sysconfdir}/rc.d/rc5.d/S05dlog
@@ -121,7 +123,8 @@ ln -s /opt/etc/.debuglevel /etc/profile.d/dlevel.sh
 %files  -n libdlog
 /usr/share/license/%{name}
 %doc LICENSE
-/opt/etc/.debuglevel
+/opt/etc/.dloglevel
+/etc/profile.d/tizen_platform_env.sh
 %{_libdir}/libdlog.so.0
 %{_libdir}/libdlog.so.0.0.0
 
diff --git a/tizen_platform_env.sh b/tizen_platform_env.sh
new file mode 100755 (executable)
index 0000000..b8df7c1
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ -e "/opt/etc/dlog/.platformloggingon" ]; then
+       export TIZEN_PLATFORMLOGGING_MODE=1
+fi
+
+if [ "$TIZEN_PLATFORMLOGGING_MODE" -eq "1"]; then
+       dlevel=$(cat /opt/etc/.dloglevel)
+       if [ "$dlevel" -eq "0" ]; then
+               export TIZEN_DLOG_LEVEL=0
+       elif [ "$dlevel" -eq "1" ]; then
+               export TIZEN_DLOG_LEVEL=1
+       elif [ "$dlevel" -eq "2" ]; then
+               export TIZEN_DLOG_LEVEL=2
+       elif [ "$dlevel" -eq "3" ]; then
+               export TIZEN_DLOG_LEVEL=3
+       elif [ "$dlevel" -eq "4" ]; then
+               export TIZEN_DLOG_LEVEL=4
+       elif [ "$dlevel" -eq "5" ]; then
+               export TIZEN_DLOG_LEVEL=5
+       elif [ "$dlevel" -eq "6" ]; then
+               export TIZEN_DLOG_LEVEL=6
+       elif [ "$dlevel" -eq "7" ]; then
+               export TIZEN_DLOG_LEVEL=7
+       elif [ "$dlevel" -eq "8" ]; then
+               export TIZEN_DLOG_LEVEL=8
+       else
+               export TIZEN_DLOG_LEVEL=8
+       fi
+fi