This module includes the platform abstraction for the debug log service.

Macros

#define OT_LOG_LEVEL_NONE 0
Log level None.
#define OT_LOG_LEVEL_CRIT 1
Log level Critical.
#define OT_LOG_LEVEL_WARN 2
Log level Warning.
#define OT_LOG_LEVEL_NOTE 3
Log level Notice.
#define OT_LOG_LEVEL_INFO 4
Log level Informational.
#define OT_LOG_LEVEL_DEBG 5
Log level Debug.

Typedefs

typedef int otLogLevel
This type represents the log level.
typedef enum otLogRegion otLogRegion
This enumeration represents log regions.

Enumerations

enum otLogRegion {
OT_LOG_REGION_API = 1,
OT_LOG_REGION_MLE = 2,
OT_LOG_REGION_ARP = 3,
OT_LOG_REGION_NET_DATA = 4,
OT_LOG_REGION_ICMP = 5,
OT_LOG_REGION_IP6 = 6,
OT_LOG_REGION_MAC = 7,
OT_LOG_REGION_MEM = 8,
OT_LOG_REGION_NCP = 9,
OT_LOG_REGION_MESH_COP = 10,
OT_LOG_REGION_NET_DIAG = 11,
OT_LOG_REGION_PLATFORM = 12,
OT_LOG_REGION_COAP = 13,
OT_LOG_REGION_CLI = 14,
OT_LOG_REGION_CORE = 15,
OT_LOG_REGION_UTIL = 16,
OT_LOG_REGION_BBR = 17,
OT_LOG_REGION_MLR = 18,
OT_LOG_REGION_DUA = 19
}
This enumeration represents log regions.

Functions

void otPlatLog ( otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat,...)
This function outputs logs.
void otPlatLogLine ( otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aLogLine)
This (optional) platform function outputs a prepared log line.

Detailed Description

This module includes the platform abstraction for the debug log service.

Macro Definition Documentation

OT_LOG_LEVEL_CRIT

#define OT_LOG_LEVEL_CRIT 1

Log level Critical.

Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.

OT_LOG_LEVEL_DEBG

#define OT_LOG_LEVEL_DEBG 5

Log level Debug.

Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.

OT_LOG_LEVEL_INFO

#define OT_LOG_LEVEL_INFO 4

Log level Informational.

Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.

OT_LOG_LEVEL_NONE

#define OT_LOG_LEVEL_NONE 0

Log level None.

Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.

OT_LOG_LEVEL_NOTE

#define OT_LOG_LEVEL_NOTE 3

Log level Notice.

Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.

OT_LOG_LEVEL_WARN

#define OT_LOG_LEVEL_WARN 2

Log level Warning.

Note
Log Levels are defines so that embedded implementations can eliminate code at compile time via #if/#else/#endif.

Enumeration Type Documentation

otLogRegion

This enumeration represents log regions.

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_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)

Function Documentation

otPlatLog()

void otPlatLog ( otLogLevel aLogLevel,
otLogRegion aLogRegion,
const char * aFormat,
...
)

This function outputs logs.

Parameters
[in] aLogLevel The log level.
[in] aLogRegion The log region.
[in] aFormat A pointer to the format string.
[in] ... Arguments for the format specification.

otPlatLogLine()

void otPlatLogLine ( otLogLevel aLogLevel,
otLogRegion aLogRegion,
const char * aLogLine
)

This (optional) platform function outputs a prepared log line.

This platform function is used by OpenThread core when OPENTHREAD_CONFIG_LOG_DEFINE_AS_MACRO_ONLY is not enabled (in this case, the OT core itself will prepare a full log line).

Note that this function is optional and if not provided by platform layer, a default (weak) implementation is provided and used by OpenThread core as otPlatLog(aLogLevel, aLogResion, "%s", aLogLine) .

Parameters
[in] aLogLevel The log level.
[in] aLogRegion The log region.
[in] aLogLine A pointer to a log line string.