ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
TMBOY
Date:
Tue Jul 18 16:54:45 2017 +0800
Revision:
47:9e361da97763
?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TMBOY 47:9e361da97763 1 #pragma once
TMBOY 47:9e361da97763 2 #include <stdio.h>
TMBOY 47:9e361da97763 3
TMBOY 47:9e361da97763 4 #define DEBUG_LEVEL_INF 3
TMBOY 47:9e361da97763 5 #define DEBUG_LEVEL_DBG 2
TMBOY 47:9e361da97763 6 #define DEBUG_LEVEL_WRN 1
TMBOY 47:9e361da97763 7 #define DEBUG_LEVEL_ERR 0
TMBOY 47:9e361da97763 8 #define OTA_DEBUG_LEVEL DEBUG_LEVEL_ERR
TMBOY 47:9e361da97763 9
TMBOY 47:9e361da97763 10 #define OTA_LOG(format, level, ...) do \
TMBOY 47:9e361da97763 11 { \
TMBOY 47:9e361da97763 12 if (OTA_DEBUG_LEVEL >= level) \
TMBOY 47:9e361da97763 13 { \
TMBOY 47:9e361da97763 14 printf("%s:%s: "format, __FILE__, __FUNCTION__, ##__VA_ARGS__); \
TMBOY 47:9e361da97763 15 } \
TMBOY 47:9e361da97763 16 }while(0);
TMBOY 47:9e361da97763 17
TMBOY 47:9e361da97763 18 #define OTA_LOG_INFO(format, ...) OTA_LOG(format, DEBUG_LEVEL_INF, __VA_ARGS__)
TMBOY 47:9e361da97763 19 #define OTA_LOG_DBG(format, ...) OTA_LOG(format, DEBUG_LEVEL_DBG, __VA_ARGS__)
TMBOY 47:9e361da97763 20 #define OTA_LOG_WARN(format, ...) OTA_LOG(format, DEBUG_LEVEL_WRN, __VA_ARGS__)
TMBOY 47:9e361da97763 21 #define OTA_LOG_ERR(format, ...) OTA_LOG(format, DEBUG_LEVEL_ERR, __VA_ARGS__)
TMBOY 47:9e361da97763 22
TMBOY 47:9e361da97763 23 #define OTA_FUNC_ENTER() OTA_LOG_INFO("enter %s:%s\n", __FILE__, __FUNCTION__)
TMBOY 47:9e361da97763 24 #define OTA_FUNC_LEAVE() OTA_LOG_INFO("leave %s:%s\n", __FILE__, __FUNCTION__)