X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=log.c;h=e973395fad4cda4bd1bad846e858f592e0b1d399;hb=310597132825b77a3114ec60a39bff39364c4ab6;hp=d7be833162b3d1ee2d575674ec807ec6c4376c81;hpb=2e3629600bd116eae941f69d769c6ef1dee9de97;p=framework%2Fsystem%2Fdlog.git diff --git a/log.c b/log.c index d7be833..e973395 100755 --- a/log.c +++ b/log.c @@ -13,10 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifdef HAVE_PTHREADS #include -#endif #include #include #include @@ -25,7 +22,10 @@ #include #include #include - +#ifdef SD_JOURNAL_SUPPORT +#include +#include +#endif #define LOG_BUF_SIZE 1024 #define LOG_MAIN "log_main" @@ -33,23 +33,18 @@ #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; } - 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 +52,22 @@ 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