Plugin updated
[platform/adaptation/artik/lbs-plugin-gps-artik7.git] / gps-plugin / include / gps_plugin_debug.h
1 /*
2  * gps-manager replay plugin
3  *
4  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __GPS_PLUGIN_DEBUG_H__
20 #define __GPS_PLUGIN_DEBUG_H__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #define GPS_DLOG
27 #define GPS_DLOG_DEBUG          /* filename and line number will be shown */
28
29 #ifdef GPS_DLOG
30 #include <dlog.h>
31 #define TAG_GPS_PLUGIN          "LBS_GPS_PLUGIN"
32
33 #define DBG_LOW         LOG_DEBUG
34 #define DBG_INFO        LOG_INFO
35 #define DBG_WARN        LOG_WARN
36 #define DBG_ERR         LOG_ERROR
37
38 #ifdef GPS_DLOG_DEBUG           /* Debug mode */
39 #define LOG_PLUGIN(dbg_lvl, fmt, args...)               SLOG(dbg_lvl, TAG_GPS_PLUGIN, fmt, ##args)
40 #define SECLOG_PLUGIN(dbg_lvl, fmt, args...)    SECURE_SLOG(dbg_lvl, TAG_GPS_PLUGIN, "[%-40s: %-4d] "fmt, __FILE__, __LINE__, ##args)
41 #else                           /* Release(commercial) mode */
42 #define LOG_PLUGIN(dbg_lvl, fmt, args...)               SLOG(dbg_lvl, TAG_GPS_PLUGIN, fmt, ##args)
43 #define SECLOG_PLUGIN(dbg_lvl, fmt, args...)    SECURE_SLOG(dbg_lvl, TAG_GPS_PLUGIN, fmt, ##args)
44 #endif
45 #endif
46
47 #ifdef __cplusplus
48 }
49 #endif
50 #endif