1 /* 2 * Copyright 2022 NXP 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 #if !defined(NXPESELOG__H_INCLUDED) 18 #define NXPESELOG__H_INCLUDED 19 #include <stdint.h> 20 21 extern uint8_t ese_log_level; 22 23 /* ####################### LOG LEVELS ################### */ 24 25 #define NXPESE_LOGLEVEL_SILENT 0x00 26 #define NXPESE_LOGLEVEL_ERROR 0x01 27 #define NXPESE_LOGLEVEL_WARN 0x02 28 #define NXPESE_LOGLEVEL_INFO 0x03 29 #define NXPESE_LOGLEVEL_DEBUG 0x04 30 31 /* ######################################################## 32 */ 33 /* Macros */ 34 35 #define NXP_LOG_ESE_D(...) \ 36 { ALOGD_IF(ese_log_level >= NXPESE_LOGLEVEL_DEBUG, __VA_ARGS__); } 37 38 #define NXP_LOG_ESE_I(...) \ 39 { ALOGI_IF(ese_log_level >= NXPESE_LOGLEVEL_INFO, __VA_ARGS__); } 40 41 #define NXP_LOG_ESE_W(...) \ 42 { ALOGW_IF(ese_log_level >= NXPESE_LOGLEVEL_WARN, __VA_ARGS__); } 43 44 #define NXP_LOG_ESE_E(...) \ 45 { ALOGE_IF(ese_log_level >= NXPESE_LOGLEVEL_ERROR, __VA_ARGS__); } 46 47 #endif /* NXPESELOG__H_INCLUDED */ 48