RDK Documentation (Open Sourced RDK Components)
pwrlogger.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 
22 
23 /**
24 * @defgroup iarmmgrs
25 * @{
26 * @defgroup power
27 * @{
28 **/
29 
30 
31 #ifndef _IARM_PWRMGR_LOGGER_
32 #define _IARM_PWRMGR_LOGGER_
33 
34 
35 #include <string.h>
36 
37 
38 #ifdef RDK_LOGGER_ENABLED
39 #include "rdk_debug.h"
40 #include "iarmUtil.h"
41 
42 extern int b_rdk_logger_enabled;
43 
44 
45 #define LOG(...) INT_LOG(__VA_ARGS__, "")
46 #define INT_LOG(FORMAT, ...) if(b_rdk_logger_enabled) {\
47 RDK_LOG(RDK_LOG_DEBUG, "LOG.RDK.POWERMGR", FORMAT , __VA_ARGS__);\
48 }\
49 else\
50 {\
51 printf(FORMAT, __VA_ARGS__);\
52 }
53 
54 
55 #else
56 
57 #define LOG(...) printf(__VA_ARGS__)
58 
59 #endif
60 
61 
62 #endif
63 
64 
65 /** @} */
66 /** @} */
rdk_debug.h