AWS IoT Device SDK C: Logging
Generate and print log messages
Return to main page ↑
IotLog

Logging function for a specific library. In most cases, this is the logging function to call.

#define IotLog( messageLevel, pLogConfig, ... )

This function prints a single log message. It is available when LIBRARY_LOG_LEVEL is not IOT_LOG_NONE. Log messages automatically include the log level, library name, and time. An optional IotLogConfig_t may be passed to this function to hide information for a single log message.

The logging library must be set up before this function may be called. See Setup and use for more information.

This logging function also has the following abbreviated forms that can be used when an IotLogConfig_t isn't needed.

Name Equivalent to
IotLogError
IotLog( IOT_LOG_ERROR, NULL, ... )
IotLogWarn
IotLog( IOT_LOG_WARN, NULL, ... )
IotLogInfo
IotLog( IOT_LOG_INFO, NULL, ... )
IotLogDebug
IotLog( IOT_LOG_DEBUG, NULL, ... )
Parameters
[in]messageLevelLog level of this message. Must be one of the Log levels.
[in]pLogConfigPointer to an IotLogConfig_t. Optional; pass NULL to ignore.
[in]...Message and format specification.
Returns
No return value. On errors, it prints nothing.
Note
This function may be implemented as a macro.
See also
IotLog_Generic for the generic (not library-specific) logging function.