Apply requirement for gcov automation
[platform/core/system/libstorage.git] / include / log.h
1 /*
2  * storage
3  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18
19 #ifndef __LOG_H__
20 #define __LOG_H__
21
22 #ifdef ENABLE_STORAGE_DLOG
23 #define ENABLE_DLOG
24 #endif
25
26 #define LOG_TAG "LIBSTORAGE"
27
28 #ifdef ENABLE_DLOG
29 #include <dlog.h>
30 #define _D(fmt, arg...) \
31         do { SLOGD(fmt, ##arg); } while (0)
32 #define _I(fmt, arg...) \
33         do { SLOGI(fmt, ##arg); } while (0)
34 #define _W(fmt, arg...) \
35         do { SLOGW(fmt, ##arg); } while (0)
36 #define _E(fmt, arg...) \
37         do { SLOGE(fmt, ##arg); } while (0)
38 #define _SD(fmt, arg...) \
39         do { SECURE_SLOGD(fmt, ##arg); } while (0)
40 #define _SI(fmt, arg...) \
41         do { SECURE_SLOGI(fmt, ##arg); } while (0)
42 #define _SW(fmt, arg...) \
43         do { SECURE_SLOGW(fmt, ##arg); } while (0)
44 #define _SE(fmt, arg...) \
45         do { SECURE_SLOGE(fmt, ##arg); } while (0)
46 #else
47 #define _D(...)  do { } while (0)
48 #define _I(...)  do { } while (0)
49 #define _W(...)  do { } while (0)
50 #define _E(...)  do { } while (0)
51 #define _SD(...)   do { } while (0)
52 #define _SI(...)   do { } while (0)
53 #define _SW(...)   do { } while (0)
54 #define _SE(...)   do { } while (0)
55 #endif
56
57 #endif