input_hal branch
[staging/toyota.git] / inc / input_hal_debug.h
1 /*
2  * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION.
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 INC_INPUT_HAL_DEBUG_H_
18 #define INC_INPUT_HAL_DEBUG_H_
19
20 #include "input_hal_frameworkunifiedlog.h"
21
22 // #define INPUT_DEBUG
23
24 #ifdef INPUT_DEBUG
25 #define INPUT_DBG_LOG(zone_index, fmt, ...) \
26   FRAMEWORKUNIFIEDLOG(zone_index, __FUNCTION__, fmt, ## __VA_ARGS__);
27 #else
28 #define INPUT_DBG_LOG(zone_index, fmt, ...)
29 #endif
30
31 /* Log output control flag */
32 #define INPUT_LOG_ENABLE_TRACE    /* Normal log(Trace)    */
33 #define INPUT_LOG_ENABLE_ERROR    /* Error log            */
34 #define INPUT_LOG_ENABLE_RETAIL   /* Debug log            */
35
36 #ifdef INPUT_LOG_ENABLE_TRACE
37 #define INPUT_LOG_TRACE(fmt, ...) \
38   FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, fmt, ## __VA_ARGS__);
39 #else
40 #define INPUT_LOG_TRACE(fmt, ...)
41 #endif
42
43 #ifdef INPUT_LOG_ENABLE_ERROR
44 #define INPUT_ERROR_LOG(fmt, ...)  \
45   FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, fmt, ## __VA_ARGS__);
46 #else
47 #define INPUT_ERROR_LOG(fmt, ...)
48 #endif
49
50 #ifdef INPUT_LOG_ENABLE_RETAIL
51 #define INPUT_RETAIL_LOG(fmt, ...) \
52   FRAMEWORKUNIFIEDLOG(ZONE_HMI_DBG, __FUNCTION__, fmt, ## __VA_ARGS__);
53 #else
54 #define INPUT_RETAIL_LOG(fmt, ...)
55 #endif
56
57 #endif  // INC_INPUT_HAL_DEBUG_H_