Apply tizen coding rule
[platform/framework/web/download-provider.git] / provider / include / download-provider-log.h
1 /*
2  * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef DOWNLOAD_PROVIDER2_LOG_H
18 #define DOWNLOAD_PROVIDER2_LOG_H
19
20 #ifdef SUPPORT_LOG_MESSAGE
21 #include <errno.h>
22 #include <dlog.h>
23 #ifdef LOG_TAG
24 #undef LOG_TAG
25 #endif
26 #define LOG_TAG DOWNLOAD_PROVIDER_LOG_TAG
27 #if defined(LOGD) && defined(TIZEN_DEBUG_ENABLE)
28 #define TRACE_DEBUG(format, ARG...) LOGD(format, ##ARG)
29 #else
30 #define TRACE_DEBUG(...) do { } while (0)
31 #endif
32 #define TRACE_ERROR(format, ARG...) LOGE(format, ##ARG)
33 #define TRACE_STRERROR(format, ARG...) LOGE(format" [%s]", ##ARG)
34 #define TRACE_INFO(format, ARG...) LOGI(format, ##ARG)
35 #define TRACE_WARN(format, ARG...) LOGW(format, ##ARG)
36
37 #if defined(SECURE_LOGD) && defined(TIZEN_DEBUG_ENABLE)
38 #define TRACE_SECURE_DEBUG(format, ARG...) SECURE_LOGD(format, ##ARG)
39 #else
40 #define TRACE_SECURE_DEBUG(...) do { } while (0)
41 #endif
42 #if defined(SECURE_LOGI) && defined(TIZEN_DEBUG_ENABLE)
43 #define TRACE_SECURE_INFO(format, ARG...) SECURE_LOGI(format, ##ARG)
44 #else
45 #define TRACE_SECURE_INFO(...) do { } while (0)
46 #endif
47 #if defined(SECURE_LOGE) && defined(TIZEN_DEBUG_ENABLE)
48 #define TRACE_SECURE_ERROR(format, ARG...) SECURE_LOGE(format, ##ARG)
49 #else
50 #define TRACE_SECURE_ERROR(...) do { } while (0)
51 #endif
52
53 #else
54 #define TRACE_DEBUG(...) do { } while (0)
55 #define TRACE_ERROR(...) do { } while (0)
56 #define TRACE_ERROR(...) do { } while (0)
57 #define TRACE_INFO(...) do { } while (0)
58 #define TRACE_WARN(...) do { } while (0)
59 #define TRACE_SECURE_DEBUG(...) do { } while (0)
60 #define TRACE_SECURE_INFO(...) do { } while (0)
61 #define TRACE_SECURE_ERROR(...) do { } while (0)
62 #endif
63
64 #endif