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.
Dependencies: X_NUCLEO_IKS01A1 mbed FP MQTTPacket DnsQuery ATParser
MQTT/MQTTLogging.h@0:4cdaf9b1e7d0, 2017-09-27 (annotated)
- Committer:
- PavelSavyhin
- Date:
- Wed Sep 27 14:40:52 2017 +0300
- Revision:
- 0:4cdaf9b1e7d0
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| PavelSavyhin | 0:4cdaf9b1e7d0 | 1 | #if !defined(MQTT_LOGGING_H) |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 2 | #define MQTT_LOGGING_H |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 3 | |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 4 | #define STREAM stdout |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 5 | #if !defined(DEBUG) |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 6 | #define DEBUG(...) \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 7 | {\ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 8 | fprintf(STREAM, "DEBUG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 9 | fprintf(STREAM, ##__VA_ARGS__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 10 | fflush(STREAM); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 11 | } |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 12 | #endif |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 13 | #if !defined(LOG) |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 14 | #define LOG(...) \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 15 | {\ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 16 | fprintf(STREAM, "LOG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 17 | fprintf(STREAM, ##__VA_ARGS__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 18 | fflush(STREAM); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 19 | } |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 20 | #endif |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 21 | #if !defined(WARN) |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 22 | #define WARN(...) \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 23 | { \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 24 | fprintf(STREAM, "WARN: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 25 | fprintf(STREAM, ##__VA_ARGS__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 26 | fflush(STREAM); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 27 | } |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 28 | #endif |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 29 | #if !defined(ERROR) |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 30 | #define ERROR(...) \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 31 | { \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 32 | fprintf(STREAM, "ERROR: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 33 | fprintf(STREAM, ##__VA_ARGS__); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 34 | fflush(STREAM); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 35 | exit(1); \ |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 36 | } |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 37 | #endif |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 38 | |
| PavelSavyhin | 0:4cdaf9b1e7d0 | 39 | #endif |