Logging - Platform#
This module includes the platform abstraction for the debug log service.
Enumerations#
This enumeration represents log regions.
Typedefs#
This type represents the log level.
This enumeration represents log regions.
Functions#
This function outputs logs.
This function handles OpenThread log level changes.
Macros#
Log level None.
Log level Critical.
Log level Warning.
Log level Notice.
Log level Informational.
Log level Debug.
Enumeration Documentation#
otLogRegion#
otLogRegion
This enumeration represents log regions.
The support for log region is removed and instead each core module can define its own name to appended to the logs. However, the otLogRegion
enumeration is still defined as before to help with platforms which we may be using it in their otPlatLog()
implementation. The OT core will always emit all logs with OT_LOG_REGION_CORE
.
Enumerator | |
---|---|
OT_LOG_REGION_API | OpenThread API. |
OT_LOG_REGION_MLE | MLE. |
OT_LOG_REGION_ARP | EID-to-RLOC mapping. |
OT_LOG_REGION_NET_DATA | Network Data. |
OT_LOG_REGION_ICMP | ICMPv6. |
OT_LOG_REGION_IP6 | IPv6. |
OT_LOG_REGION_TCP | TCP. |
OT_LOG_REGION_MAC | IEEE 802.15.4 MAC. |
OT_LOG_REGION_MEM | Memory. |
OT_LOG_REGION_NCP | NCP. |
OT_LOG_REGION_MESH_COP | Mesh Commissioning Protocol. |
OT_LOG_REGION_NET_DIAG | Network Diagnostic. |
OT_LOG_REGION_PLATFORM | Platform. |
OT_LOG_REGION_COAP | CoAP. |
OT_LOG_REGION_CLI | CLI. |
OT_LOG_REGION_CORE | OpenThread Core. |
OT_LOG_REGION_UTIL | Utility module. |
OT_LOG_REGION_BBR | Backbone Router (available since Thread 1.2) |
OT_LOG_REGION_MLR | Multicast Listener Registration (available since Thread 1.2) |
OT_LOG_REGION_DUA | Domain Unicast Address (available since Thread 1.2) |
OT_LOG_REGION_BR | Border Router. |
OT_LOG_REGION_SRP | Service Registration Protocol (SRP) |
OT_LOG_REGION_DNS | DNS. |
123
of file include/openthread/platform/logging.h
Typedef Documentation#
otLogLevel#
typedef int otLogLevel
This type represents the log level.
113
of file include/openthread/platform/logging.h
otLogRegion#
typedef enum otLogRegion otLogRegion
This enumeration represents log regions.
The support for log region is removed and instead each core module can define its own name to appended to the logs. However, the otLogRegion
enumeration is still defined as before to help with platforms which we may be using it in their otPlatLog()
implementation. The OT core will always emit all logs with OT_LOG_REGION_CORE
.
148
of file include/openthread/platform/logging.h
Function Documentation#
otPlatLog#
void otPlatLog (otLogLevel aLogLevel, otLogRegion aLogRegion, const char * aFormat, ... )
This function outputs logs.
[in] | aLogLevel | The log level. |
[in] | aLogRegion | The log region. |
[in] | aFormat | A pointer to the format string. |
[in] | Arguments for the format specification. |
Note that the support for log region is removed. The OT core will always emit all logs with OT_LOG_REGION_CORE
as aLogRegion
.
162
of file include/openthread/platform/logging.h
otPlatLogHandleLevelChanged#
void otPlatLogHandleLevelChanged (otLogLevel aLogLevel)
This function handles OpenThread log level changes.
[in] | aLogLevel | The new OpenThread log level. |
This platform function is called whenever the OpenThread log level changes. This platform function is optional since an empty weak implementation has been provided.
Note
Only applicable when
OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1
.
175
of file include/openthread/platform/logging.h
Macro Definition Documentation#
OT_LOG_LEVEL_NONE#
#define OT_LOG_LEVEL_NONEValue:
0
Log level None.
Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.
62
of file include/openthread/platform/logging.h
OT_LOG_LEVEL_CRIT#
#define OT_LOG_LEVEL_CRITValue:
1
Log level Critical.
Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.
71
of file include/openthread/platform/logging.h
OT_LOG_LEVEL_WARN#
#define OT_LOG_LEVEL_WARNValue:
2
Log level Warning.
Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.
80
of file include/openthread/platform/logging.h
OT_LOG_LEVEL_NOTE#
#define OT_LOG_LEVEL_NOTEValue:
3
Log level Notice.
Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.
89
of file include/openthread/platform/logging.h
OT_LOG_LEVEL_INFO#
#define OT_LOG_LEVEL_INFOValue:
4
Log level Informational.
Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.
98
of file include/openthread/platform/logging.h
OT_LOG_LEVEL_DEBG#
#define OT_LOG_LEVEL_DEBGValue:
5
Log level Debug.
Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.
107
of file include/openthread/platform/logging.h