28 #ifndef IOT_LOGGING_SETUP_H_ 29 #define IOT_LOGGING_SETUP_H_ 32 #include "iot_config.h" 169 #if !defined( LIBRARY_LOG_LEVEL ) || \ 170 ( ( LIBRARY_LOG_LEVEL != IOT_LOG_NONE ) && \ 171 ( LIBRARY_LOG_LEVEL != IOT_LOG_ERROR ) && \ 172 ( LIBRARY_LOG_LEVEL != IOT_LOG_WARN ) && \ 173 ( LIBRARY_LOG_LEVEL != IOT_LOG_INFO ) && \ 174 ( LIBRARY_LOG_LEVEL != IOT_LOG_DEBUG ) ) 175 #error "Please define LIBRARY_LOG_LEVEL as either IOT_LOG_NONE, IOT_LOG_ERROR, IOT_LOG_WARN, IOT_LOG_INFO, or IOT_LOG_DEBUG." 177 #elif !defined( LIBRARY_LOG_NAME ) 178 #error "Please define LIBRARY_LOG_NAME." 181 #if LIBRARY_LOG_LEVEL > IOT_LOG_NONE 182 #define IotLog( messageLevel, pLogConfig, ... ) \ 183 IotLog_Generic( LIBRARY_LOG_LEVEL, \ 190 #define IotLogError( ... ) IotLog( IOT_LOG_ERROR, NULL, __VA_ARGS__ ) 191 #define IotLogWarn( ... ) IotLog( IOT_LOG_WARN, NULL, __VA_ARGS__ ) 192 #define IotLogInfo( ... ) IotLog( IOT_LOG_INFO, NULL, __VA_ARGS__ ) 193 #define IotLogDebug( ... ) IotLog( IOT_LOG_DEBUG, NULL, __VA_ARGS__ ) 196 #if LIBRARY_LOG_LEVEL >= IOT_LOG_DEBUG 197 #define IotLog_PrintBuffer( pHeader, pBuffer, bufferSize ) \ 198 IotLog_GenericPrintBuffer( LIBRARY_LOG_NAME, \ 203 #define IotLog_PrintBuffer( pHeader, pBuffer, bufferSize ) 208 #define IotLog( messageLevel, pLogConfig, ... ) 211 #define IotLog_PrintBuffer( pHeader, pBuffer, bufferSize ) 213 #define IotLogError( ... ) 214 #define IotLogWarn( ... ) 215 #define IotLogInfo( ... ) 216 #define IotLogDebug( ... ) Generic logging function header file.