Skip to main content

otSetLogLevel

Function otSetLogLevel 

Source
pub unsafe extern "C" fn otSetLogLevel(
    aInstance: *mut otInstance,
    aLogLevel: otLogLevel,
) -> otError
Expand description

Sets the log level for a given OpenThread instance.

@note This function requires OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1.

In a single-instance configuration, this function sets the log level for the instance.

In a multi-instance configuration (OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE), if OPENTHREAD_CONFIG_LOG_INSTANCE_AWARE_API_ENABLE is not enabled, this function returns OT_ERROR_NOT_CAPABLE. When the log level is explicitly set on an instance, it overrides the global log level set using otLoggingSetLevel().

@param[in] aInstance The OpenThread instance. @param[in] aLogLevel The log level.

@retval OT_ERROR_NONE Successfully updated the log level. @retval OT_ERROR_INVALID_ARGS Log level value is invalid. @retval OT_ERROR_NOT_CAPABLE Instance-aware logging is not enabled in a multi-instance configuration.