Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ota/baidu_iot_ota_log.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New 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__) |
