diff options
Diffstat (limited to 'Projects/P-NUCLEO-WB55.USBDongle/Applications/Zigbee/Zigbee_OnOff_Server_Coord/Core/Inc/stm_logging.h')
-rw-r--r-- | Projects/P-NUCLEO-WB55.USBDongle/Applications/Zigbee/Zigbee_OnOff_Server_Coord/Core/Inc/stm_logging.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Zigbee/Zigbee_OnOff_Server_Coord/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Zigbee/Zigbee_OnOff_Server_Coord/Core/Inc/stm_logging.h new file mode 100644 index 000000000..58877c570 --- /dev/null +++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Zigbee/Zigbee_OnOff_Server_Coord/Core/Inc/stm_logging.h @@ -0,0 +1,55 @@ +/** + ****************************************************************************** + * File Name : stm_logging.h + * Description : Application header file for logging + ****************************************************************************** + * @attention + * + * <h2><center>© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.</center></h2> + * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +#ifndef STM_LOGGING_H_ +#define STM_LOGGING_H_ + +#define LOG_LEVEL_NONE 0 /* None */ +#define LOG_LEVEL_CRIT 1U /* Critical */ +#define LOG_LEVEL_WARN 2U /* Warning */ +#define LOG_LEVEL_INFO 3U /* Info */ +#define LOG_LEVEL_DEBG 4U /* Debug */ + +#define APP_DBG_FULL(level, region, ...) \ + if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \ + { \ + printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \ + } \ + logApplication(level, region, __VA_ARGS__); + +#define APP_DBG(...) \ + if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \ + { \ + printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \ + } \ + logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__); + +/** + * This enumeration represents log regions. + * + */ +typedef enum { + APPLI_LOG_REGION_GENERAL = 1U, /* General */ + APPLI_LOG_REGION_ZIGBEE_API = 2U, /* OpenThread API */ +} appliLogRegion_t; + +typedef uint8_t appliLogLevel_t; + +void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...); + +#endif /* STM_LOGGING_H_ */ |