merge with master
[platform/core/api/face.git] / src / face-debug.h
1 /*
2  * Copyright (c) 2011 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 #ifndef __FACE_DEBUG_H__
17 #define __FACE_DEBUG_H__
18
19 #include <dlog.h>
20 #include "statistics.h"
21
22 #define PERF_TIME
23
24 #define LVL1 "  "
25 #define LVL2 "    "
26 #define LVL3 "      "
27 #define LVL4 "        "
28 #define LVL5 "          "
29 #define LVL6 "            "
30
31 #ifdef PERF_TIME
32
33 // accum item handling
34 #define PERF_CHECK_BEGIN(name)          mm_ta_accum_item_begin(name,false,__FILE__,__LINE__)
35 #define PERF_CHECK_END(name)            mm_ta_accum_item_end(name,false,__FILE__,__LINE__)
36
37 // Print out
38 #define PERF_SHOW_RESULT(fp)            mm_ta_accum_show_result_fp(fp)
39
40 #else
41
42 #define PERF_CHECK_BEGIN(name)
43 #define PERF_CHECK_END(name)
44
45 // Print out
46 #define PERF_SHOW_RESULT(fp)
47
48 #endif          // PERF_TIME
49
50 #ifdef LOG_TAG
51 #undef LOG_TAG
52 #endif
53
54 #define LOG_TAG "TIZEN_N_FACE"
55
56 #define LOG_INFO(fmt, ...)      LOGI("[F:%-16.16s L:%5d] " fmt, __func__, __LINE__ , ##__VA_ARGS__)
57 #define LOG_ERROR(fmt, ...) LOGE("[F:%-16.16s L:%5d] " fmt, __func__, __LINE__ , ##__VA_ARGS__)
58 #define LOG_FATAL(fmt, ...)     LOGE("[F:%-16.16s L:%5d] " fmt, __func__, __LINE__ , ##__VA_ARGS__)
59
60 // #define LOG_DEBUG(fmt, ...)  LOGD("[F:%-16.16s L:%5d] " fmt, __func__, __LINE__ , ##__VA_ARGS__)
61
62 #define LOG_DEBUG(fmt, ...)
63
64
65 #endif //__FACE_DEBUG_H__