Logging Service

This module includes configuration variables for the Logging service.

Summary

Macros

OPENTHREAD_CONFIG_LOG_CLI 1
Define to enable CLI logging and otLogCli() OT function.
OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_CRIT
The log level (used at compile time).
OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0
Define as 1 to enable dynamic log level control.
OPENTHREAD_CONFIG_LOG_LEVEL_INIT OPENTHREAD_CONFIG_LOG_LEVEL
The initial log level used when OpenThread is initialized.
OPENTHREAD_CONFIG_LOG_MAX_SIZE 150
The maximum log string size (number of chars).
OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
Selects if, and where the LOG output goes to.
OPENTHREAD_CONFIG_LOG_OUTPUT_APP 2
Log output goes to the "application" provided otPlatLog() in NCP and CLI code.
OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART 1
Log output goes to the debug uart - requires OPENTHREAD_CONFIG_ENABLE_DEBUG_UART to be enabled.
OPENTHREAD_CONFIG_LOG_OUTPUT_NONE 0
Log output goes to the bit bucket (disabled)
OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED 3
Log output is handled by a platform defined function.
OPENTHREAD_CONFIG_LOG_PKT_DUMP 1
Define to enable dump logs (of packets).
OPENTHREAD_CONFIG_LOG_PLATFORM 1
Define to enable platform logging and otLog{Level}Plat() OT functions.
OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1
Define to prepend the log level to all log messages.
OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME 0
Define as 1 to prepend the current uptime to all log messages.
OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES 1
If defined as 1 when IPv6 message info is logged in mesh-forwarder, the source and destination IPv6 addresses of messages are also included.
OPENTHREAD_CONFIG_LOG_SUFFIX ""
Define suffix to append at the end of logs.

Macros

OPENTHREAD_CONFIG_LOG_CLI

 OPENTHREAD_CONFIG_LOG_CLI 1

Define to enable CLI logging and otLogCli() OT function.

OPENTHREAD_CONFIG_LOG_LEVEL

 OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_CRIT

The log level (used at compile time).

If OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE is set, this defines the most verbose log level possible. See OPENTHREAD_CONFIG_LOG_LEVEL_INIT to set the initial log level.

OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE

 OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE 0

Define as 1 to enable dynamic log level control.

Note that the OPENTHREAD_CONFIG_LOG_LEVEL determines the log level at compile time. The dynamic log level control (if enabled) only allows decreasing the log level from the compile time value.

OPENTHREAD_CONFIG_LOG_LEVEL_INIT

 OPENTHREAD_CONFIG_LOG_LEVEL_INIT OPENTHREAD_CONFIG_LOG_LEVEL

The initial log level used when OpenThread is initialized.

See OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE.

OPENTHREAD_CONFIG_LOG_MAX_SIZE

 OPENTHREAD_CONFIG_LOG_MAX_SIZE 150

The maximum log string size (number of chars).

OPENTHREAD_CONFIG_LOG_OUTPUT

 OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED

Selects if, and where the LOG output goes to.

There are several options available

Note:

1) Because the default is: OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED The platform is expected to provide at least a stub for otPlatLog().

2) This is effectively an ENUM so it can be if/else/endif at compile time.

OPENTHREAD_CONFIG_LOG_OUTPUT_APP

 OPENTHREAD_CONFIG_LOG_OUTPUT_APP 2

Log output goes to the "application" provided otPlatLog() in NCP and CLI code.

OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART

 OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART 1

Log output goes to the debug uart - requires OPENTHREAD_CONFIG_ENABLE_DEBUG_UART to be enabled.

OPENTHREAD_CONFIG_LOG_OUTPUT_NONE

 OPENTHREAD_CONFIG_LOG_OUTPUT_NONE 0

Log output goes to the bit bucket (disabled)

OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED

 OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED 3

Log output is handled by a platform defined function.

OPENTHREAD_CONFIG_LOG_PKT_DUMP

 OPENTHREAD_CONFIG_LOG_PKT_DUMP 1

Define to enable dump logs (of packets).

OPENTHREAD_CONFIG_LOG_PLATFORM

 OPENTHREAD_CONFIG_LOG_PLATFORM 1

Define to enable platform logging and otLog{Level}Plat() OT functions.

OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL

 OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1

Define to prepend the log level to all log messages.

OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME

 OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME 0

Define as 1 to prepend the current uptime to all log messages.

OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES

 OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES 1

If defined as 1 when IPv6 message info is logged in mesh-forwarder, the source and destination IPv6 addresses of messages are also included.

OPENTHREAD_CONFIG_LOG_SUFFIX

 OPENTHREAD_CONFIG_LOG_SUFFIX ""

Define suffix to append at the end of logs.

Resources

OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.