X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=log.c;h=314a42b1d7d6f8000950763144afacdb955fa612;hb=0547a5d44e24f3b1c832624113787395e9f7467f;hp=d7be833162b3d1ee2d575674ec807ec6c4376c81;hpb=2e3629600bd116eae941f69d769c6ef1dee9de97;p=framework%2Fsystem%2Fdlog.git diff --git a/log.c b/log.c index d7be833..314a42b 100755 --- a/log.c +++ b/log.c @@ -1,11 +1,13 @@ /* - * Copyright (C) 2007 The Android Open Source Project + * DLOG + * Copyright (c) 2005-2008, The Android Open Source Project + * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,10 +15,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 +24,10 @@ #include #include #include - +#ifdef SD_JOURNAL_SUPPORT +#include +#include +#endif #define LOG_BUF_SIZE 1024 #define LOG_MAIN "log_main" @@ -33,43 +35,35 @@ #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_init = 0; +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; int log_fd; struct iovec vec[3]; - if (log_id < LOG_ID_APPS) { - if(prio