IoT managed integrations End Device SDK
Loading...
Searching...
No Matches
Macros
iotmi_device_logging_stack.h File Reference

Utility header file that exposes macros for configuring logging implementation of logging macros (LogError, LogWarn, LogInfo, LogDebug). More...

#include "iotmi_device_logging_levels.h"
#include <stdint.h>
#include <stdio.h>
#include "iotmi_pal_Clock.h"
#include "iotmi_pal_Log.h"
#include "iotmi_device_Version.h"

Go to the source code of this file.

Macros

#define LOG_METADATA_FORMAT    "[%u][%s][%s]"
 The name of the library or demo to add as metadata in log messages from the library or demo.
 
#define LOG_METADATA_ARGS
 Arguments into the metadata logging \ prefix format.
 
#define iotmiDev_logError   iotmiPal_logError
 
#define iotmiDev_logWarn   iotmiPal_logWarn
 
#define iotmiDev_logInfo   iotmiPal_logInfo
 
#define iotmiDev_logDebug   iotmiPal_logDebug
 
#define COMPILE_TIME_ERROR(msg)    void compile_time_error(void) { (void)sizeof(char[1 - 2 * !!(msg)]); }
 
#define InternalLog_Unsupported(...)    COMPILE_TIME_ERROR("Unsupported log format")
 
#define InternalLogError_1(format)
 
#define InternalLogError_Multiple(format, ...)
 
#define InternalLogErrorFormatter(...)
 
#define InternalLogErrorMacroSelect(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
 
#define InternalLogWarn_1(format)
 
#define InternalLogWarn_Multiple(format, ...)
 
#define InternalLogWarnFormatter(...)
 
#define InternalLogWarnMacroSelect(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
 
#define InternalLogInfo_1(format)
 
#define InternalLogInfo_Multiple(format, ...)
 
#define InternalLogInfoFormatter(...)
 
#define InternalLogInfoMacroSelect(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
 
#define InternalLogDebug_1(format)
 
#define InternalLogDebug_Multiple(format, ...)
 
#define InternalLogDebugFormatter(...)
 
#define InternalLogDebugMacroSelect(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)    N
 

Detailed Description

Utility header file that exposes macros for configuring logging implementation of logging macros (LogError, LogWarn, LogInfo, LogDebug).

Macro Definition Documentation

◆ InternalLogDebug_1

#define InternalLogDebug_1 (   format)
Value:
iotmiDev_logDebug(LOG_METADATA_FORMAT "[DEBUG] " format "\r\n", \
#define LOG_METADATA_ARGS
Arguments into the metadata logging \ prefix format.
Definition iotmi_device_logging_stack.h:66
#define LOG_METADATA_FORMAT
The name of the library or demo to add as metadata in log messages from the library or demo.
Definition iotmi_device_logging_stack.h:61

◆ InternalLogDebug_Multiple

#define InternalLogDebug_Multiple (   format,
  ... 
)
Value:
iotmiDev_logDebug(LOG_METADATA_FORMAT "[DEBUG] " format "\r\n", \
LOG_METADATA_ARGS, __VA_ARGS__)

◆ InternalLogDebugFormatter

#define InternalLogDebugFormatter (   ...)
Value:
InternalLogDebugMacroSelect( \
__VA_ARGS__, InternalLogDebug_Multiple, InternalLogDebug_Multiple, \
InternalLogDebug_Multiple, InternalLogDebug_Multiple, \
InternalLogDebug_Multiple, InternalLogDebug_Multiple, \
InternalLogDebug_Multiple, InternalLogDebug_Multiple, \
InternalLogDebug_Multiple, InternalLogDebug_1, \
InternalLog_Unsupported)(__VA_ARGS__)

◆ InternalLogError_1

#define InternalLogError_1 (   format)
Value:
iotmiDev_logError(LOG_METADATA_FORMAT "[ERROR] " format "\r\n", \

◆ InternalLogError_Multiple

#define InternalLogError_Multiple (   format,
  ... 
)
Value:
iotmiDev_logError(LOG_METADATA_FORMAT "[ERROR] " format "\r\n", \
LOG_METADATA_ARGS, __VA_ARGS__)

◆ InternalLogErrorFormatter

#define InternalLogErrorFormatter (   ...)
Value:
InternalLogErrorMacroSelect( \
__VA_ARGS__, InternalLogError_Multiple, InternalLogError_Multiple, \
InternalLogError_Multiple, InternalLogError_Multiple, \
InternalLogError_Multiple, InternalLogError_Multiple, \
InternalLogError_Multiple, InternalLogError_Multiple, \
InternalLogError_Multiple, InternalLogError_1, \
InternalLog_Unsupported)(__VA_ARGS__)

◆ InternalLogInfo_1

#define InternalLogInfo_1 (   format)
Value:
iotmiDev_logInfo(LOG_METADATA_FORMAT "[INFO] " format "\r\n", \

◆ InternalLogInfo_Multiple

#define InternalLogInfo_Multiple (   format,
  ... 
)
Value:
iotmiDev_logInfo(LOG_METADATA_FORMAT "[INFO] " format "\r\n", \
LOG_METADATA_ARGS, __VA_ARGS__)

◆ InternalLogInfoFormatter

#define InternalLogInfoFormatter (   ...)
Value:
InternalLogInfoMacroSelect( \
__VA_ARGS__, InternalLogInfo_Multiple, InternalLogInfo_Multiple, \
InternalLogInfo_Multiple, InternalLogInfo_Multiple, \
InternalLogInfo_Multiple, InternalLogInfo_Multiple, \
InternalLogInfo_Multiple, InternalLogInfo_Multiple, \
InternalLogInfo_Multiple, InternalLogInfo_1, \
InternalLog_Unsupported)(__VA_ARGS__)

◆ InternalLogWarn_1

#define InternalLogWarn_1 (   format)
Value:
iotmiDev_logWarn(LOG_METADATA_FORMAT "[WARN] " format "\r\n", \

◆ InternalLogWarn_Multiple

#define InternalLogWarn_Multiple (   format,
  ... 
)
Value:
iotmiDev_logWarn(LOG_METADATA_FORMAT "[WARN] " format "\r\n", \
LOG_METADATA_ARGS, __VA_ARGS__)

◆ InternalLogWarnFormatter

#define InternalLogWarnFormatter (   ...)
Value:
InternalLogWarnMacroSelect( \
__VA_ARGS__, InternalLogWarn_Multiple, InternalLogWarn_Multiple, \
InternalLogWarn_Multiple, InternalLogWarn_Multiple, \
InternalLogWarn_Multiple, InternalLogWarn_Multiple, \
InternalLogWarn_Multiple, InternalLogWarn_Multiple, \
InternalLogWarn_Multiple, InternalLogWarn_1, \
InternalLog_Unsupported)(__VA_ARGS__)

◆ LOG_METADATA_ARGS

#define LOG_METADATA_ARGS
Value:
iotmiPal_clockGetTimeMs(), IOTMI_DEVICE_SDK_VERSION, \
LIBRARY_LOG_NAME
uint32_t iotmiPal_clockGetTimeMs(void)
The timer query function.

Arguments into the metadata logging \ prefix format.

◆ LOG_METADATA_FORMAT

#define LOG_METADATA_FORMAT    "[%u][%s][%s]"

The name of the library or demo to add as metadata in log messages from the library or demo.

This metadata aids in identifying the module source of log messages. The metadata is logged in the format [ <LIBRARY-NAME> ] as a prefix to the log messages. Refer to LOG_METADATA_FORMAT for the complete format of the metadata prefix in log messages.

Format of metadata prefix in log messages.