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
MQTTLogging.h
00001 #if !defined(MQTT_LOGGING_H) 00002 #define MQTT_LOGGING_H 00003 00004 #define STREAM stdout 00005 #if !defined(DEBUG) 00006 #define DEBUG(...) \ 00007 {\ 00008 fprintf(STREAM, "DEBUG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ 00009 fprintf(STREAM, ##__VA_ARGS__); \ 00010 fflush(STREAM); \ 00011 } 00012 #endif 00013 #if !defined(LOG) 00014 #define LOG(...) \ 00015 {\ 00016 fprintf(STREAM, "LOG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ 00017 fprintf(STREAM, ##__VA_ARGS__); \ 00018 fflush(STREAM); \ 00019 } 00020 #endif 00021 #if !defined(WARN) 00022 #define WARN(...) \ 00023 { \ 00024 fprintf(STREAM, "WARN: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ 00025 fprintf(STREAM, ##__VA_ARGS__); \ 00026 fflush(STREAM); \ 00027 } 00028 #endif 00029 #if !defined(ERROR) 00030 #define ERROR(...) \ 00031 { \ 00032 fprintf(STREAM, "ERROR: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \ 00033 fprintf(STREAM, ##__VA_ARGS__); \ 00034 fflush(STREAM); \ 00035 exit(1); \ 00036 } 00037 #endif 00038 00039 #endif
Generated on Wed Jul 13 2022 21:16:17 by
