From cb4b28313bf69796b3aba0844584507bf9cf2e00 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 26 Mar 2026 22:24:49 -0700 Subject: [PATCH] [logging] add support for per-instance log levels (#12740) This commit introduces the ability to set and manage log levels on a per-instance basis when dynamic logging is enabled, while maintaining backward compatibility with existing logging behaviors. The existing `otLoggingGetLevel()` and `otLoggingSetLevel()` APIs are repurposed to manage the "global" log level. They continue to behave exactly as before in both single-instance and multi-instance configurations, ensuring that existing users of these APIs do not need to change their implementations. To provide more granular control, new APIs `otGetLogLevel()` and `otSetLogLevel()` are added to handle per-instance log levels. Specifically, this commit makes the following changes: - Adds `mLogLevel` to `Instance` to track the instance-specific log level. - Renames the global log level static variable to `sGlobalLogLevel` and introduces `GetGlobalLogLevel()` and `SetGlobalLogLevel()` to manage it in a multi-instance configuration. - Updates `otGetLogLevel()` and `otSetLogLevel()` APIs to handle per-instance log level retrieval and configuration. If a specific level is not set for an instance, it falls back to the global log level. - Adds `mIsLogLevelSet` to distinguish between an explicitly set instance log level and the global fallback in multi-instance builds. - Introduces `otPlatLogHandleLogLevelChanged()` platform callback to notify the platform when an instance-specific log level is updated. - Updates Nexus tests to use `SetGlobalLogLevel()` instead of the deprecated instance `SetLogLevel()` method. --- include/openthread/instance.h | 2 +- include/openthread/logging.h | 58 ++++++++++++++++++-- include/openthread/platform/logging.h | 22 +++++++- src/cli/cli.cpp | 8 +-- src/core/api/logging_api.cpp | 35 ++++++++++-- src/core/common/log.cpp | 15 ++++- src/core/common/log.hpp | 3 + src/core/instance/instance.cpp | 61 ++++++++++++++++++--- src/core/instance/instance.hpp | 57 ++++++++++++++++--- src/core/thread/mesh_forwarder.cpp | 2 +- src/core/thread/radio_selector.cpp | 2 +- src/ncp/ncp_base.cpp | 4 +- tests/fuzz/fuzz_cli.cpp | 2 +- tests/fuzz/fuzz_icmp6.cpp | 2 +- tests/fuzz/fuzz_ip6.cpp | 2 +- tests/fuzz/fuzz_mdns.cpp | 2 +- tests/fuzz/fuzz_radio-one-node.cpp | 2 +- tests/fuzz/fuzz_trel.cpp | 2 +- tests/nexus/test_1_1_5_1_1.cpp | 2 +- tests/nexus/test_1_1_5_1_10.cpp | 2 +- tests/nexus/test_1_1_5_1_12.cpp | 2 +- tests/nexus/test_1_1_5_1_3.cpp | 2 +- tests/nexus/test_1_1_5_1_4.cpp | 2 +- tests/nexus/test_1_1_5_1_5.cpp | 2 +- tests/nexus/test_1_1_5_1_6.cpp | 2 +- tests/nexus/test_1_1_5_1_8.cpp | 2 +- tests/nexus/test_1_1_5_1_9.cpp | 2 +- tests/nexus/test_1_1_5_2_1.cpp | 2 +- tests/nexus/test_1_1_5_2_3.cpp | 2 +- tests/nexus/test_1_1_5_2_4.cpp | 2 +- tests/nexus/test_1_1_5_2_5.cpp | 2 +- tests/nexus/test_1_1_5_2_6.cpp | 2 +- tests/nexus/test_1_1_5_2_7.cpp | 2 +- tests/nexus/test_1_1_5_3_1.cpp | 2 +- tests/nexus/test_1_1_5_3_10.cpp | 2 +- tests/nexus/test_1_1_5_3_11.cpp | 2 +- tests/nexus/test_1_1_5_3_2.cpp | 2 +- tests/nexus/test_1_1_5_3_3.cpp | 2 +- tests/nexus/test_1_1_5_3_4.cpp | 2 +- tests/nexus/test_1_1_5_3_5.cpp | 2 +- tests/nexus/test_1_1_5_3_6.cpp | 2 +- tests/nexus/test_1_1_5_3_7.cpp | 2 +- tests/nexus/test_1_1_5_3_8.cpp | 2 +- tests/nexus/test_1_1_5_3_9.cpp | 2 +- tests/nexus/test_1_1_5_5_1.cpp | 2 +- tests/nexus/test_1_1_5_5_2.cpp | 2 +- tests/nexus/test_1_1_5_5_3.cpp | 2 +- tests/nexus/test_1_1_5_5_4_1.cpp | 2 +- tests/nexus/test_1_1_5_5_4_2.cpp | 2 +- tests/nexus/test_1_1_5_5_5.cpp | 2 +- tests/nexus/test_1_1_5_5_7.cpp | 2 +- tests/nexus/test_1_1_5_6_1.cpp | 2 +- tests/nexus/test_1_1_5_6_2.cpp | 2 +- tests/nexus/test_1_1_5_6_3.cpp | 2 +- tests/nexus/test_1_1_5_6_4.cpp | 2 +- tests/nexus/test_1_1_5_6_5.cpp | 2 +- tests/nexus/test_1_1_5_6_6.cpp | 2 +- tests/nexus/test_1_1_5_6_7.cpp | 2 +- tests/nexus/test_1_1_5_6_9.cpp | 2 +- tests/nexus/test_1_1_5_7_1.cpp | 2 +- tests/nexus/test_1_1_5_7_2.cpp | 2 +- tests/nexus/test_1_1_5_7_3.cpp | 2 +- tests/nexus/test_1_1_5_8_2.cpp | 2 +- tests/nexus/test_1_1_5_8_3.cpp | 2 +- tests/nexus/test_1_1_5_8_4.cpp | 2 +- tests/nexus/test_1_1_6_1_1.cpp | 2 +- tests/nexus/test_1_1_6_1_2.cpp | 2 +- tests/nexus/test_1_1_6_1_3.cpp | 2 +- tests/nexus/test_1_1_6_1_4.cpp | 2 +- tests/nexus/test_1_1_6_1_5.cpp | 2 +- tests/nexus/test_1_1_6_1_6.cpp | 2 +- tests/nexus/test_1_1_6_1_7.cpp | 2 +- tests/nexus/test_1_1_6_2_1.cpp | 2 +- tests/nexus/test_1_1_6_2_2.cpp | 2 +- tests/nexus/test_1_1_6_3_1.cpp | 2 +- tests/nexus/test_1_1_6_3_2.cpp | 2 +- tests/nexus/test_1_1_6_4_1.cpp | 2 +- tests/nexus/test_1_1_6_4_2.cpp | 2 +- tests/nexus/test_1_1_6_5_1.cpp | 2 +- tests/nexus/test_1_1_6_5_2.cpp | 2 +- tests/nexus/test_1_1_6_5_3.cpp | 2 +- tests/nexus/test_1_1_6_6_1.cpp | 2 +- tests/nexus/test_1_1_6_6_2.cpp | 2 +- tests/nexus/test_1_1_7_1_1.cpp | 2 +- tests/nexus/test_1_1_7_1_2.cpp | 2 +- tests/nexus/test_1_1_7_1_3.cpp | 2 +- tests/nexus/test_1_1_7_1_4.cpp | 2 +- tests/nexus/test_1_1_7_1_5.cpp | 2 +- tests/nexus/test_1_1_7_1_6.cpp | 2 +- tests/nexus/test_1_1_7_1_7.cpp | 2 +- tests/nexus/test_1_1_7_1_8.cpp | 2 +- tests/nexus/test_1_1_8_1_1.cpp | 2 +- tests/nexus/test_1_1_8_1_2.cpp | 2 +- tests/nexus/test_1_1_8_1_6.cpp | 2 +- tests/nexus/test_1_1_8_2_1.cpp | 2 +- tests/nexus/test_1_1_8_2_2.cpp | 2 +- tests/nexus/test_1_1_8_3_1.cpp | 2 +- tests/nexus/test_1_1_9_2_1.cpp | 2 +- tests/nexus/test_1_1_9_2_10.cpp | 2 +- tests/nexus/test_1_1_9_2_11.cpp | 2 +- tests/nexus/test_1_1_9_2_12.cpp | 2 +- tests/nexus/test_1_1_9_2_13.cpp | 2 +- tests/nexus/test_1_1_9_2_14.cpp | 2 +- tests/nexus/test_1_1_9_2_15.cpp | 2 +- tests/nexus/test_1_1_9_2_16.cpp | 2 +- tests/nexus/test_1_1_9_2_17.cpp | 2 +- tests/nexus/test_1_1_9_2_18.cpp | 2 +- tests/nexus/test_1_1_9_2_19.cpp | 2 +- tests/nexus/test_1_1_9_2_2.cpp | 2 +- tests/nexus/test_1_1_9_2_3.cpp | 2 +- tests/nexus/test_1_1_9_2_4.cpp | 2 +- tests/nexus/test_1_1_9_2_5.cpp | 2 +- tests/nexus/test_1_1_9_2_6.cpp | 2 +- tests/nexus/test_1_1_9_2_7.cpp | 2 +- tests/nexus/test_1_1_9_2_8.cpp | 2 +- tests/nexus/test_1_1_9_2_9.cpp | 2 +- tests/nexus/test_1_2_BBR_TC_1.cpp | 2 +- tests/nexus/test_1_2_BBR_TC_2.cpp | 2 +- tests/nexus/test_1_2_BBR_TC_3.cpp | 2 +- tests/nexus/test_1_2_LP_5_2_1.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_1.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_2.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_3.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_4.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_5.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_6.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_7.cpp | 2 +- tests/nexus/test_1_2_LP_5_3_8.cpp | 2 +- tests/nexus/test_1_2_LP_7_1_1.cpp | 2 +- tests/nexus/test_1_2_LP_7_1_2.cpp | 2 +- tests/nexus/test_1_2_LP_7_2_1.cpp | 2 +- tests/nexus/test_1_2_LP_7_2_2.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_1.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_10.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_12.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_15.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_16.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_19.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_2.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_20.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_21.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_22.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_23.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_26.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_3.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_4.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_5.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_7.cpp | 2 +- tests/nexus/test_1_2_MATN_TC_9.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_1.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_10.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_2.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_3.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_6.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_7A.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_7B.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_7C.cpp | 2 +- tests/nexus/test_1_3_DBR_TC_8.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_1.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_2.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_3.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_4.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_5.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_6.cpp | 2 +- tests/nexus/test_1_3_SRP_TC_8.cpp | 2 +- tests/nexus/test_border_admitter.cpp | 2 +- tests/nexus/test_form_join.cpp | 5 +- tests/nexus/test_mle_blocking_downgrade.cpp | 5 +- tests/nexus/test_nat64_translator.cpp | 8 +-- tests/nexus/test_trel.cpp | 17 ++++-- 170 files changed, 398 insertions(+), 214 deletions(-) diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 56b266c1e..1fbce5816 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -52,7 +52,7 @@ extern "C" { * * @note This number versions both OpenThread platform and user APIs. */ -#define OPENTHREAD_API_VERSION (585) +#define OPENTHREAD_API_VERSION (586) /** * @addtogroup api-instance diff --git a/include/openthread/logging.h b/include/openthread/logging.h index 74f08d913..fc6d7ca2c 100644 --- a/include/openthread/logging.h +++ b/include/openthread/logging.h @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -56,24 +57,69 @@ extern "C" { */ /** - * Returns the current log level. + * Returns the current log level for a given OpenThread instance. * * If dynamic log level feature `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE` is enabled, this function returns the - * currently set dynamic log level. Otherwise, this function returns the build-time configured log level. + * currently set dynamic log level: + * - In a single-instance configuration, it returns the instance's log level. + * - In a multi-instance configuration, it returns the instance-specific log level if it has been explicitly set + * (see `otSetLogLevel()`). Otherwise, it returns the global log level (see `otLoggingGetLevel()`). + * + * If the dynamic log level feature is not enabled, this function returns the build-time configured log level. + * + * @param[in] aInstance The OpenThread instance. * * @returns The log level. */ +otLogLevel otGetLogLevel(otInstance *aInstance); + +/** + * 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. + */ +otError otSetLogLevel(otInstance *aInstance, otLogLevel aLogLevel); + +/** + * Returns the current global log level. + * + * In a single-instance configuration, this function behaves the same as `otGetLogLevel()`. + * In a multi-instance configuration, it returns the global log level which is used for all instances. + * + * @returns The global log level. + */ otLogLevel otLoggingGetLevel(void); /** - * Sets the log level. + * Sets the global log level. * * @note This function requires `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1`. * - * @param[in] aLogLevel The log level. + * In a single-instance configuration, this function behaves the same as `otSetLogLevel()` (which is the recommended + * function to use). * - * @retval OT_ERROR_NONE Successfully updated log level. - * @retval OT_ERROR_INVALID_ARGS Log level value is invalid. + * In a multi-instance configuration, it sets the global log level which is used by all instances. The log level can + * be explicitly set on a specific instance using `otSetLogLevel()`, which will then be used instead of the global + * value. + * + * @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. */ otError otLoggingSetLevel(otLogLevel aLogLevel); diff --git a/include/openthread/platform/logging.h b/include/openthread/platform/logging.h index 5e69e4d0a..bd64871ab 100644 --- a/include/openthread/platform/logging.h +++ b/include/openthread/platform/logging.h @@ -175,8 +175,11 @@ void otPlatLogOutput(otInstance *aInstance, otLogLevel aLogLevel, const char *aL /** * Handles OpenThread log level changes. * - * This platform function is called whenever the OpenThread log level changes. - * This platform function is optional since an empty weak implementation has been provided. + * This platform function is optional. An empty weak implementation is provided by OpenThread core. + * + * This platform function is called whenever the OpenThread log level changes: + * - In a single-instance configuration, this is called when the log level changes. + * - In a multi-instance configuration, this is called when the global log level changes. * * @note Only applicable when `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1`. * @@ -184,6 +187,21 @@ void otPlatLogOutput(otInstance *aInstance, otLogLevel aLogLevel, const char *aL */ void otPlatLogHandleLevelChanged(otLogLevel aLogLevel); +/** + * Handles OpenThread instance-specific log level changes. + * + * This platform function is optional. An empty weak implementation is provided by OpenThread core. + * + * This platform function is called whenever the instance-specific log level changes: + * - In a single-instance configuration, this is called along with `otPlatLogHandleLevelChanged()`. + * - In a multi-instance configuration, if `OPENTHREAD_CONFIG_LOG_INSTANCE_AWARE_API_ENABLE` is used, this is called + * when the instance-specific log level changes. + * + * @param[in] aInstance A pointer to the OpenThread instance. + * @param[in] aLogLevel The new OpenThread log level for the instance. + */ +void otPlatLogHandleLogLevelChanged(otInstance *aInstance, otLogLevel aLogLevel); + /** * @} */ diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 570205e63..37eab21d3 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -3033,13 +3033,13 @@ template <> otError Interpreter::Process(Arg aArgs[]) * @endcode * @par * Get the log level. - * @sa otLoggingGetLevel + * @sa otGetLogLevel */ if (aArgs[0] == "level") { if (aArgs[1].IsEmpty()) { - OutputLine("%d", otLoggingGetLevel()); + OutputLine("%u", otGetLogLevel(GetInstancePtr())); } else { @@ -3053,12 +3053,12 @@ template <> otError Interpreter::Process(Arg aArgs[]) * Done * @endcode * @par api_copy - * #otLoggingSetLevel + * #otSetLogLevel * @cparam log level @ca{level} */ VerifyOrExit(aArgs[2].IsEmpty(), error = OT_ERROR_INVALID_ARGS); SuccessOrExit(error = aArgs[1].ParseAsUint8(level)); - error = otLoggingSetLevel(static_cast(level)); + error = otSetLogLevel(GetInstancePtr(), static_cast(level)); #else error = OT_ERROR_INVALID_ARGS; #endif diff --git a/src/core/api/logging_api.cpp b/src/core/api/logging_api.cpp index 406ea9641..d339330c5 100644 --- a/src/core/api/logging_api.cpp +++ b/src/core/api/logging_api.cpp @@ -37,20 +37,43 @@ using namespace ot; -otLogLevel otLoggingGetLevel(void) { return static_cast(Instance::GetLogLevel()); } +otLogLevel otGetLogLevel(otInstance *aInstance) { return MapEnum(AsCoreType(aInstance).GetLogLevel()); } + +otLogLevel otLoggingGetLevel(void) +{ + LogLevel level; + +#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + level = Instance::Get().GetLogLevel(); +#else + level = Instance::GetGlobalLogLevel(); +#endif + + return MapEnum(level); +} #if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE + +otError otSetLogLevel(otInstance *aInstance, otLogLevel aLogLevel) +{ + return AsCoreType(aInstance).SetLogLevel(MapEnum(aLogLevel)); +} + otError otLoggingSetLevel(otLogLevel aLogLevel) { - Error error = kErrorNone; + Error error; + LogLevel level = MapEnum(aLogLevel); - VerifyOrExit(aLogLevel <= kLogLevelDebg && aLogLevel >= kLogLevelNone, error = kErrorInvalidArgs); - Instance::SetLogLevel(static_cast(aLogLevel)); +#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + error = Instance::Get().SetLogLevel(level); +#else + error = Instance::SetGlobalLogLevel(level); +#endif -exit: return error; } -#endif + +#endif // OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE static const char kPlatformModuleName[] = "Platform"; diff --git a/src/core/common/log.cpp b/src/core/common/log.cpp index 495ae44b4..2f8ee0e3e 100644 --- a/src/core/common/log.cpp +++ b/src/core/common/log.cpp @@ -139,9 +139,22 @@ void Logger::Log(const char *aModuleName, LogLevel aLogLevel, Error aError, cons #endif #if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE - VerifyOrExit(Instance::GetLogLevel() >= aLogLevel); + +#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + VerifyOrExit(Instance::Get().GetLogLevel() >= aLogLevel); +#elif !OPENTHREAD_CONFIG_LOG_INSTANCE_AWARE_API_ENABLE + VerifyOrExit(Instance::GetGlobalLogLevel() >= aLogLevel); +#else + { + Instance *instance = Instance::GetActiveInstance(); + + VerifyOrExit(instance != nullptr); + VerifyOrExit(instance->GetLogLevel() >= aLogLevel); + } #endif +#endif // OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE + #if OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL { static const char kLevelChars[] = { diff --git a/src/core/common/log.hpp b/src/core/common/log.hpp index a099e67df..440285369 100644 --- a/src/core/common/log.hpp +++ b/src/core/common/log.hpp @@ -40,6 +40,7 @@ #include #include +#include "common/as_core_type.hpp" #include "common/error.hpp" namespace ot { @@ -460,6 +461,8 @@ typedef otLogHexDumpInfo HexDumpInfo; ///< Represents the hex dump info. */ Error GenerateNextHexDumpLine(HexDumpInfo &aInfo); +DefineMapEnum(otLogLevel, LogLevel); + } // namespace ot #endif // OT_CORE_COMMON_LOG_HPP_ diff --git a/src/core/instance/instance.cpp b/src/core/instance/instance.cpp index 263f62ba3..df44a6b59 100644 --- a/src/core/instance/instance.cpp +++ b/src/core/instance/instance.cpp @@ -73,8 +73,8 @@ Utils::Heap *Instance::sHeap{nullptr}; #endif #endif -#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE -LogLevel Instance::sLogLevel = static_cast(OPENTHREAD_CONFIG_LOG_LEVEL_INIT); +#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE && OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +LogLevel Instance::sGlobalLogLevel = static_cast(OPENTHREAD_CONFIG_LOG_LEVEL_INIT); #endif Instance::Instance(void) @@ -316,6 +316,13 @@ Instance::Instance(void) #endif #if OPENTHREAD_CONFIG_POWER_CALIBRATION_ENABLE && OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE , mPowerCalibration(*this) +#endif +#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE + , mLogLevel(static_cast(OPENTHREAD_CONFIG_LOG_LEVEL_INIT)) +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + , mIsLogLevelSet(false) +#else +#endif #endif , mIsInitialized(false) , mId(Random::NonCrypto::GetUint32()) @@ -578,17 +585,53 @@ void Instance::ResetBufferInfo(void) { Get().ResetMaxUsedBufferCoun #if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE -void Instance::SetLogLevel(LogLevel aLogLevel) +Error Instance::SetLogLevel(LogLevel aLogLevel) { - if (aLogLevel != sLogLevel) - { - sLogLevel = aLogLevel; - otPlatLogHandleLevelChanged(sLogLevel); - } + Error error = kErrorNone; + + VerifyOrExit(aLogLevel <= kLogLevelDebg, error = kErrorInvalidArgs); + +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && !OPENTHREAD_CONFIG_LOG_INSTANCE_AWARE_API_ENABLE + ExitNow(error = kErrorNotCapable); +#else + VerifyOrExit(mLogLevel != aLogLevel); + mLogLevel = aLogLevel; + +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + mIsLogLevelSet = true; +#else + otPlatLogHandleLevelChanged(mLogLevel); +#endif + otPlatLogHandleLogLevelChanged(this, mLogLevel); +#endif + +exit: + return error; } +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE +Error Instance::SetGlobalLogLevel(LogLevel aLogLevel) +{ + Error error = kErrorNone; + + VerifyOrExit(aLogLevel <= kLogLevelDebg, error = kErrorInvalidArgs); + VerifyOrExit(sGlobalLogLevel != aLogLevel); + sGlobalLogLevel = aLogLevel; + otPlatLogHandleLevelChanged(sGlobalLogLevel); + +exit: + return error; +} +#endif + extern "C" OT_TOOL_WEAK void otPlatLogHandleLevelChanged(otLogLevel aLogLevel) { OT_UNUSED_VARIABLE(aLogLevel); } -#endif +extern "C" OT_TOOL_WEAK void otPlatLogHandleLogLevelChanged(otInstance *aInstance, otLogLevel aLogLevel) +{ + OT_UNUSED_VARIABLE(aInstance); + OT_UNUSED_VARIABLE(aLogLevel); +} + +#endif // OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE } // namespace ot diff --git a/src/core/instance/instance.hpp b/src/core/instance/instance.hpp index b21b1078b..09a8afa7a 100644 --- a/src/core/instance/instance.hpp +++ b/src/core/instance/instance.hpp @@ -317,14 +317,30 @@ public: * * @returns The log level. */ - static LogLevel GetLogLevel(void) -#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE - { - return sLogLevel; - } -#else + LogLevel GetLogLevel(void) const { +#if !OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE return static_cast(OPENTHREAD_CONFIG_LOG_LEVEL); +#elif !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + return mLogLevel; +#else + return (mIsLogLevelSet) ? mLogLevel : sGlobalLogLevel; +#endif + } + +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + /** + * Returns the global log level. + * + * @returns The global log level. + */ + static LogLevel GetGlobalLogLevel(void) + { +#if !OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE + return static_cast(OPENTHREAD_CONFIG_LOG_LEVEL); +#else + return sGlobalLogLevel; +#endif } #endif @@ -333,9 +349,25 @@ public: * Sets the log level. * * @param[in] aLogLevel A log level. + * + * @retval kErrorNone Successfully updated the log level. + * @retval kErrorInvalidArgs The given log level is invalid. + * @retval kErrorNotCapable Instance-aware logging is not enabled in a multi-instance configuration. */ - static void SetLogLevel(LogLevel aLogLevel); + Error SetLogLevel(LogLevel aLogLevel); + +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + /** + * Sets the global log level. + * + * @param[in] aLogLevel A log level. + * + * @retval kErrorNone Successfully updated the log level. + * @retval kErrorInvalidArgs The given log level is invalid. + */ + static Error SetGlobalLogLevel(LogLevel aLogLevel); #endif +#endif // OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE /** * Finalizes the OpenThread instance. @@ -461,8 +493,8 @@ private: //----------------------------------------------------------------------------------------------------------------- // `static` variables -#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE - static LogLevel sLogLevel; +#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE && OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + static LogLevel sGlobalLogLevel; #endif #if (OPENTHREAD_MTD || OPENTHREAD_FTD) && !OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE @@ -796,6 +828,13 @@ private: Utils::PowerCalibration mPowerCalibration; #endif +#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE + LogLevel mLogLevel; +#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE + bool mIsLogLevelSet; +#endif +#endif + bool mIsInitialized; uint32_t mId; diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp index 7bceab642..6b5bce2f8 100644 --- a/src/core/thread/mesh_forwarder.cpp +++ b/src/core/thread/mesh_forwarder.cpp @@ -1547,7 +1547,7 @@ void MeshForwarder::LogMessage(MessageAction aAction, break; } - VerifyOrExit(Instance::GetLogLevel() >= logLevel); + VerifyOrExit(GetInstance().GetLogLevel() >= logLevel); switch (aMessage.GetType()) { diff --git a/src/core/thread/radio_selector.cpp b/src/core/thread/radio_selector.cpp index f0a0c19e0..4c16ea011 100644 --- a/src/core/thread/radio_selector.cpp +++ b/src/core/thread/radio_selector.cpp @@ -361,7 +361,7 @@ void RadioSelector::Log(LogLevel aLogLevel, String preferenceString; bool isFirstEntry = true; - VerifyOrExit(Instance::GetLogLevel() >= aLogLevel); + VerifyOrExit(GetInstance().GetLogLevel() >= aLogLevel); for (Mac::RadioType radio : sRadioSelectionOrder) { diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 9274bc2ba..044e099b5 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -2589,7 +2589,7 @@ template <> otError NcpBase::HandlePropertyGet( template <> otError NcpBase::HandlePropertyGet(void) { - return mEncoder.WriteUint8(ConvertLogLevel(otLoggingGetLevel())); + return mEncoder.WriteUint8(ConvertLogLevel(otGetLogLevel(mInstance))); } #if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE @@ -2633,7 +2633,7 @@ template <> otError NcpBase::HandlePropertySet( ExitNow(error = OT_ERROR_INVALID_ARGS); } - IgnoreError(otLoggingSetLevel(logLevel)); + IgnoreError(otSetLogLevel(mInstance, logLevel)); exit: return error; diff --git a/tests/fuzz/fuzz_cli.cpp b/tests/fuzz/fuzz_cli.cpp index 42c37c3f1..dcde321fa 100644 --- a/tests/fuzz/fuzz_cli.cpp +++ b/tests/fuzz/fuzz_cli.cpp @@ -107,7 +107,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Node &node = nexus.CreateNode(); - node.GetInstance().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(node.GetInstance().SetLogLevel(kLogLevelInfo)); otCliInit(&node.GetInstance(), CliOutput, nullptr); diff --git a/tests/fuzz/fuzz_icmp6.cpp b/tests/fuzz/fuzz_icmp6.cpp index ec5d8cff4..99ed219e2 100644 --- a/tests/fuzz/fuzz_icmp6.cpp +++ b/tests/fuzz/fuzz_icmp6.cpp @@ -98,7 +98,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Node &node = nexus.CreateNode(); - node.GetInstance().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(node.GetInstance().SetLogLevel(kLogLevelInfo)); node.GetInstance().Get().Init(/* aInfraIfIndex */ 1, /* aInfraIfIsRunning */ true); SuccessOrQuit(node.GetInstance().Get().SetEnabled(true)); diff --git a/tests/fuzz/fuzz_ip6.cpp b/tests/fuzz/fuzz_ip6.cpp index 46c48e0f6..5354a9c35 100644 --- a/tests/fuzz/fuzz_ip6.cpp +++ b/tests/fuzz/fuzz_ip6.cpp @@ -110,7 +110,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Node &node = nexus.CreateNode(); - node.GetInstance().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(node.GetInstance().SetLogLevel(kLogLevelInfo)); node.GetInstance().Get().Init(/* aInfraIfIndex */ 1, /* aInfraIfIsRunning */ true); SuccessOrQuit(node.GetInstance().Get().SetEnabled(true)); diff --git a/tests/fuzz/fuzz_mdns.cpp b/tests/fuzz/fuzz_mdns.cpp index b4b13bbb4..a54a17701 100644 --- a/tests/fuzz/fuzz_mdns.cpp +++ b/tests/fuzz/fuzz_mdns.cpp @@ -109,7 +109,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Node &node = nexus.CreateNode(); - node.GetInstance().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(node.GetInstance().SetLogLevel(kLogLevelInfo)); node.GetInstance().Get().Init(/* aInfraIfIndex */ 1, /* aInfraIfIsRunning */ true); SuccessOrQuit(node.GetInstance().Get().SetEnabled(true)); diff --git a/tests/fuzz/fuzz_radio-one-node.cpp b/tests/fuzz/fuzz_radio-one-node.cpp index 1c799488e..9b50bf97a 100644 --- a/tests/fuzz/fuzz_radio-one-node.cpp +++ b/tests/fuzz/fuzz_radio-one-node.cpp @@ -108,7 +108,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Node &node = nexus.CreateNode(); - node.GetInstance().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(node.GetInstance().SetLogLevel(kLogLevelInfo)); node.GetInstance().Get().Init(/* aInfraIfIndex */ 1, /* aInfraIfIsRunning */ true); SuccessOrQuit(node.GetInstance().Get().SetEnabled(true)); diff --git a/tests/fuzz/fuzz_trel.cpp b/tests/fuzz/fuzz_trel.cpp index 8bdb63d24..317d425d2 100644 --- a/tests/fuzz/fuzz_trel.cpp +++ b/tests/fuzz/fuzz_trel.cpp @@ -99,7 +99,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Node &node = nexus.CreateNode(); - node.GetInstance().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(node.GetInstance().SetLogLevel(kLogLevelInfo)); node.GetInstance().Get().Init(/* aInfraIfIndex */ 1, /* aInfraIfIsRunning */ true); SuccessOrQuit(node.GetInstance().Get().SetEnabled(true)); diff --git a/tests/nexus/test_1_1_5_1_1.cpp b/tests/nexus/test_1_1_5_1_1.cpp index aeac0cfee..0c7c5248a 100644 --- a/tests/nexus/test_1_1_5_1_1.cpp +++ b/tests/nexus/test_1_1_5_1_1.cpp @@ -75,7 +75,7 @@ void Test5_1_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Leader forms network"); diff --git a/tests/nexus/test_1_1_5_1_10.cpp b/tests/nexus/test_1_1_5_1_10.cpp index 030edc0de..217af60aa 100644 --- a/tests/nexus/test_1_1_5_1_10.cpp +++ b/tests/nexus/test_1_1_5_1_10.cpp @@ -95,7 +95,7 @@ void Test5_1_10(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Leader, Router_1, Router_2"); diff --git a/tests/nexus/test_1_1_5_1_12.cpp b/tests/nexus/test_1_1_5_1_12.cpp index aef59e5fd..dff11837c 100644 --- a/tests/nexus/test_1_1_5_1_12.cpp +++ b/tests/nexus/test_1_1_5_1_12.cpp @@ -87,7 +87,7 @@ void Test5_1_12(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Ensure topology is formed correctly."); diff --git a/tests/nexus/test_1_1_5_1_3.cpp b/tests/nexus/test_1_1_5_1_3.cpp index e127f3941..5ab128f67 100644 --- a/tests/nexus/test_1_1_5_1_3.cpp +++ b/tests/nexus/test_1_1_5_1_3.cpp @@ -106,7 +106,7 @@ void Test5_1_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); /** * Step 1: Router_2 diff --git a/tests/nexus/test_1_1_5_1_4.cpp b/tests/nexus/test_1_1_5_1_4.cpp index 42effe72f..49816a46c 100644 --- a/tests/nexus/test_1_1_5_1_4.cpp +++ b/tests/nexus/test_1_1_5_1_4.cpp @@ -95,7 +95,7 @@ void Test5_1_4(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); /** * Step 1: Router_2 diff --git a/tests/nexus/test_1_1_5_1_5.cpp b/tests/nexus/test_1_1_5_1_5.cpp index 0ab7eae55..2e0b8421d 100644 --- a/tests/nexus/test_1_1_5_1_5.cpp +++ b/tests/nexus/test_1_1_5_1_5.cpp @@ -84,7 +84,7 @@ void Test5_1_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_1_6.cpp b/tests/nexus/test_1_1_5_1_6.cpp index bcc4124ce..71325d5af 100644 --- a/tests/nexus/test_1_1_5_1_6.cpp +++ b/tests/nexus/test_1_1_5_1_6.cpp @@ -78,7 +78,7 @@ void Test5_1_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Verify topology is formed correctly"); diff --git a/tests/nexus/test_1_1_5_1_8.cpp b/tests/nexus/test_1_1_5_1_8.cpp index 7d383c0ae..b34b4c63c 100644 --- a/tests/nexus/test_1_1_5_1_8.cpp +++ b/tests/nexus/test_1_1_5_1_8.cpp @@ -92,7 +92,7 @@ void Test5_1_8(void) router3.SetName("ROUTER_3"); dut.SetName("ROUTER_4"); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); nexus.AdvanceTime(0); diff --git a/tests/nexus/test_1_1_5_1_9.cpp b/tests/nexus/test_1_1_5_1_9.cpp index 2e0589d1c..510587f5c 100644 --- a/tests/nexus/test_1_1_5_1_9.cpp +++ b/tests/nexus/test_1_1_5_1_9.cpp @@ -104,7 +104,7 @@ void Test5_1_9(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); /** * Step 1: Leader, Router_1, REED_2, REED_1 diff --git a/tests/nexus/test_1_1_5_2_1.cpp b/tests/nexus/test_1_1_5_2_1.cpp index 0dabc591f..6763557a9 100644 --- a/tests/nexus/test_1_1_5_2_1.cpp +++ b/tests/nexus/test_1_1_5_2_1.cpp @@ -95,7 +95,7 @@ void Test5_2_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Router_1 (DUT)"); diff --git a/tests/nexus/test_1_1_5_2_3.cpp b/tests/nexus/test_1_1_5_2_3.cpp index c1bcbccbc..b670fb686 100644 --- a/tests/nexus/test_1_1_5_2_3.cpp +++ b/tests/nexus/test_1_1_5_2_3.cpp @@ -86,7 +86,7 @@ void Test5_2_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); leader.Get().SetRouterUpgradeThreshold(kMaxRouters); leader.Get().SetRouterDowngradeThreshold(kMaxRouters); diff --git a/tests/nexus/test_1_1_5_2_4.cpp b/tests/nexus/test_1_1_5_2_4.cpp index 6d19e5a59..79bb5f2e7 100644 --- a/tests/nexus/test_1_1_5_2_4.cpp +++ b/tests/nexus/test_1_1_5_2_4.cpp @@ -107,7 +107,7 @@ void Test5_2_4(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** Use AllowList feature to restrict the topology. */ for (uint16_t i = 0; i < kNumRouters; i++) diff --git a/tests/nexus/test_1_1_5_2_5.cpp b/tests/nexus/test_1_1_5_2_5.cpp index b76c1d600..470ba38e0 100644 --- a/tests/nexus/test_1_1_5_2_5.cpp +++ b/tests/nexus/test_1_1_5_2_5.cpp @@ -110,7 +110,7 @@ void Test5_2_5(void) reed1.SetName("REED_1"); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Use AllowList feature to restrict the topology. diff --git a/tests/nexus/test_1_1_5_2_6.cpp b/tests/nexus/test_1_1_5_2_6.cpp index 4a7cd34a8..7307c9829 100644 --- a/tests/nexus/test_1_1_5_2_6.cpp +++ b/tests/nexus/test_1_1_5_2_6.cpp @@ -108,7 +108,7 @@ void Test_5_2_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); leader.Get().SetRouterUpgradeThreshold(kRouterUpgradeThreshold); leader.Get().SetRouterDowngradeThreshold(kRouterDowngradeThreshold); diff --git a/tests/nexus/test_1_1_5_2_7.cpp b/tests/nexus/test_1_1_5_2_7.cpp index 4559b7880..a8c28253d 100644 --- a/tests/nexus/test_1_1_5_2_7.cpp +++ b/tests/nexus/test_1_1_5_2_7.cpp @@ -109,7 +109,7 @@ void Test5_2_7(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_1.cpp b/tests/nexus/test_1_1_5_3_1.cpp index 7e8d0a661..89381f386 100644 --- a/tests/nexus/test_1_1_5_3_1.cpp +++ b/tests/nexus/test_1_1_5_3_1.cpp @@ -83,7 +83,7 @@ void Test5_3_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Router_1 and Leader"); diff --git a/tests/nexus/test_1_1_5_3_10.cpp b/tests/nexus/test_1_1_5_3_10.cpp index 407036952..b1b7bc5be 100644 --- a/tests/nexus/test_1_1_5_3_10.cpp +++ b/tests/nexus/test_1_1_5_3_10.cpp @@ -119,7 +119,7 @@ void Test5_3_10(void) med1.SetName("MED_1"); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 1: Border Router"); diff --git a/tests/nexus/test_1_1_5_3_11.cpp b/tests/nexus/test_1_1_5_3_11.cpp index 9852ae212..4d92b1c29 100644 --- a/tests/nexus/test_1_1_5_3_11.cpp +++ b/tests/nexus/test_1_1_5_3_11.cpp @@ -99,7 +99,7 @@ void Test5_3_11(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_2.cpp b/tests/nexus/test_1_1_5_3_2.cpp index d9e8c201d..9fc098692 100644 --- a/tests/nexus/test_1_1_5_3_2.cpp +++ b/tests/nexus/test_1_1_5_3_2.cpp @@ -86,7 +86,7 @@ void Test5_3_2(void) dut.SetName("DUT"); sed1.SetName("SED_1"); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_5_3_3.cpp b/tests/nexus/test_1_1_5_3_3.cpp index 5689e29bc..d1f4fa6b4 100644 --- a/tests/nexus/test_1_1_5_3_3.cpp +++ b/tests/nexus/test_1_1_5_3_3.cpp @@ -109,7 +109,7 @@ void Test5_3_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_4.cpp b/tests/nexus/test_1_1_5_3_4.cpp index 5eddadbca..f4c7a7890 100644 --- a/tests/nexus/test_1_1_5_3_4.cpp +++ b/tests/nexus/test_1_1_5_3_4.cpp @@ -100,7 +100,7 @@ void Test5_3_4(void) Node *meds[] = {&med1, &med2, &med3, &med4}; - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_5.cpp b/tests/nexus/test_1_1_5_3_5.cpp index 2e1cd296c..c4fec54d9 100644 --- a/tests/nexus/test_1_1_5_3_5.cpp +++ b/tests/nexus/test_1_1_5_3_5.cpp @@ -106,7 +106,7 @@ void Test5_3_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_6.cpp b/tests/nexus/test_1_1_5_3_6.cpp index fda6f62d4..5d12cd63a 100644 --- a/tests/nexus/test_1_1_5_3_6.cpp +++ b/tests/nexus/test_1_1_5_3_6.cpp @@ -80,7 +80,7 @@ void Test5_3_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_7.cpp b/tests/nexus/test_1_1_5_3_7.cpp index 131b6bac8..09275a8ce 100644 --- a/tests/nexus/test_1_1_5_3_7.cpp +++ b/tests/nexus/test_1_1_5_3_7.cpp @@ -104,7 +104,7 @@ void Test5_3_7(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_3_8.cpp b/tests/nexus/test_1_1_5_3_8.cpp index 282523c1b..6c11eb652 100644 --- a/tests/nexus/test_1_1_5_3_8.cpp +++ b/tests/nexus/test_1_1_5_3_8.cpp @@ -123,7 +123,7 @@ void Test5_3_8(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** Use AllowList feature to restrict the topology. */ leader.AllowList(br); diff --git a/tests/nexus/test_1_1_5_3_9.cpp b/tests/nexus/test_1_1_5_3_9.cpp index 44982a4f0..b960832a8 100644 --- a/tests/nexus/test_1_1_5_3_9.cpp +++ b/tests/nexus/test_1_1_5_3_9.cpp @@ -125,7 +125,7 @@ void Test5_3_9(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: Leader diff --git a/tests/nexus/test_1_1_5_5_1.cpp b/tests/nexus/test_1_1_5_5_1.cpp index 5a1f18bdf..3b4a68ae5 100644 --- a/tests/nexus/test_1_1_5_5_1.cpp +++ b/tests/nexus/test_1_1_5_5_1.cpp @@ -89,7 +89,7 @@ void Test5_5_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_5_2.cpp b/tests/nexus/test_1_1_5_5_2.cpp index 3d4b88ca9..013b28d84 100644 --- a/tests/nexus/test_1_1_5_5_2.cpp +++ b/tests/nexus/test_1_1_5_5_2.cpp @@ -105,7 +105,7 @@ void Test5_5_2(void) router1.SetName("ROUTER_1"); med1.SetName("MED_1"); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_5_5_3.cpp b/tests/nexus/test_1_1_5_5_3.cpp index 07dd12e0f..395bf5c6e 100644 --- a/tests/nexus/test_1_1_5_5_3.cpp +++ b/tests/nexus/test_1_1_5_5_3.cpp @@ -99,7 +99,7 @@ void Test5_5_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: All"); diff --git a/tests/nexus/test_1_1_5_5_4_1.cpp b/tests/nexus/test_1_1_5_5_4_1.cpp index c35cb5de6..431ffa342 100644 --- a/tests/nexus/test_1_1_5_5_4_1.cpp +++ b/tests/nexus/test_1_1_5_5_4_1.cpp @@ -104,7 +104,7 @@ void Test5_5_4_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_5_4_2.cpp b/tests/nexus/test_1_1_5_5_4_2.cpp index 563c41fe0..b19d69c76 100644 --- a/tests/nexus/test_1_1_5_5_4_2.cpp +++ b/tests/nexus/test_1_1_5_5_4_2.cpp @@ -112,7 +112,7 @@ void Test5_5_4_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_5_5_5.cpp b/tests/nexus/test_1_1_5_5_5.cpp index 389d52972..7818e02ff 100644 --- a/tests/nexus/test_1_1_5_5_5.cpp +++ b/tests/nexus/test_1_1_5_5_5.cpp @@ -99,7 +99,7 @@ void Test5_5_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_5_7.cpp b/tests/nexus/test_1_1_5_5_7.cpp index ffedd4a9a..e0e0becd9 100644 --- a/tests/nexus/test_1_1_5_5_7.cpp +++ b/tests/nexus/test_1_1_5_5_7.cpp @@ -95,7 +95,7 @@ void Test5_5_7(void) router2.SetName("ROUTER_2"); router3.SetName("ROUTER_3"); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_6_1.cpp b/tests/nexus/test_1_1_5_6_1.cpp index 15f5620d6..f36f10a86 100644 --- a/tests/nexus/test_1_1_5_6_1.cpp +++ b/tests/nexus/test_1_1_5_6_1.cpp @@ -101,7 +101,7 @@ void Test5_6_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); /** diff --git a/tests/nexus/test_1_1_5_6_2.cpp b/tests/nexus/test_1_1_5_6_2.cpp index 4e6a5af5e..c6359ec95 100644 --- a/tests/nexus/test_1_1_5_6_2.cpp +++ b/tests/nexus/test_1_1_5_6_2.cpp @@ -104,7 +104,7 @@ void Test5_6_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); /** diff --git a/tests/nexus/test_1_1_5_6_3.cpp b/tests/nexus/test_1_1_5_6_3.cpp index 25ffbb058..f66bd3e51 100644 --- a/tests/nexus/test_1_1_5_6_3.cpp +++ b/tests/nexus/test_1_1_5_6_3.cpp @@ -96,7 +96,7 @@ void Test5_6_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_6_4.cpp b/tests/nexus/test_1_1_5_6_4.cpp index 33e4fd4ca..3c1a53b2d 100644 --- a/tests/nexus/test_1_1_5_6_4.cpp +++ b/tests/nexus/test_1_1_5_6_4.cpp @@ -98,7 +98,7 @@ void Test5_6_4(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_6_5.cpp b/tests/nexus/test_1_1_5_6_5.cpp index bc11ad41c..511733663 100644 --- a/tests/nexus/test_1_1_5_6_5.cpp +++ b/tests/nexus/test_1_1_5_6_5.cpp @@ -88,7 +88,7 @@ void Test5_6_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_6_6.cpp b/tests/nexus/test_1_1_5_6_6.cpp index 4da54a28e..662256c14 100644 --- a/tests/nexus/test_1_1_5_6_6.cpp +++ b/tests/nexus/test_1_1_5_6_6.cpp @@ -112,7 +112,7 @@ void Test5_6_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_6_7.cpp b/tests/nexus/test_1_1_5_6_7.cpp index f6ddfa64d..5a54a4edc 100644 --- a/tests/nexus/test_1_1_5_6_7.cpp +++ b/tests/nexus/test_1_1_5_6_7.cpp @@ -126,7 +126,7 @@ void Test5_6_7(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_6_9.cpp b/tests/nexus/test_1_1_5_6_9.cpp index e1384728b..0f11d1612 100644 --- a/tests/nexus/test_1_1_5_6_9.cpp +++ b/tests/nexus/test_1_1_5_6_9.cpp @@ -130,7 +130,7 @@ void Test5_6_9(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); med1.Get().SetTimeout(kLargeTimeout); sed1.Get().SetTimeout(kLargeTimeout); diff --git a/tests/nexus/test_1_1_5_7_1.cpp b/tests/nexus/test_1_1_5_7_1.cpp index 41a1fc867..b29ce7caa 100644 --- a/tests/nexus/test_1_1_5_7_1.cpp +++ b/tests/nexus/test_1_1_5_7_1.cpp @@ -90,7 +90,7 @@ void Test5_7_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_5_7_2.cpp b/tests/nexus/test_1_1_5_7_2.cpp index 543db7c1b..8b4afe809 100644 --- a/tests/nexus/test_1_1_5_7_2.cpp +++ b/tests/nexus/test_1_1_5_7_2.cpp @@ -123,7 +123,7 @@ void Test5_7_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_7_3.cpp b/tests/nexus/test_1_1_5_7_3.cpp index 8e72ac691..7a949a51f 100644 --- a/tests/nexus/test_1_1_5_7_3.cpp +++ b/tests/nexus/test_1_1_5_7_3.cpp @@ -140,7 +140,7 @@ void Test5_7_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_5_8_2.cpp b/tests/nexus/test_1_1_5_8_2.cpp index 5bcb56f55..041c853f9 100644 --- a/tests/nexus/test_1_1_5_8_2.cpp +++ b/tests/nexus/test_1_1_5_8_2.cpp @@ -82,7 +82,7 @@ void Test5_8_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Leader forms the network"); diff --git a/tests/nexus/test_1_1_5_8_3.cpp b/tests/nexus/test_1_1_5_8_3.cpp index 85e13f0e1..e2eb15dcb 100644 --- a/tests/nexus/test_1_1_5_8_3.cpp +++ b/tests/nexus/test_1_1_5_8_3.cpp @@ -89,7 +89,7 @@ void Test5_8_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Leader forms network with KeySequenceCounter = 127"); diff --git a/tests/nexus/test_1_1_5_8_4.cpp b/tests/nexus/test_1_1_5_8_4.cpp index 2625a06c4..dda641285 100644 --- a/tests/nexus/test_1_1_5_8_4.cpp +++ b/tests/nexus/test_1_1_5_8_4.cpp @@ -96,7 +96,7 @@ void Test5_8_4(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_6_1_1.cpp b/tests/nexus/test_1_1_6_1_1.cpp index 16b262f42..767378825 100644 --- a/tests/nexus/test_1_1_6_1_1.cpp +++ b/tests/nexus/test_1_1_6_1_1.cpp @@ -98,7 +98,7 @@ void RunTest6_1_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); if (aTopology == kTopologyA) { diff --git a/tests/nexus/test_1_1_6_1_2.cpp b/tests/nexus/test_1_1_6_1_2.cpp index d42a64c46..a9959dc84 100644 --- a/tests/nexus/test_1_1_6_1_2.cpp +++ b/tests/nexus/test_1_1_6_1_2.cpp @@ -96,7 +96,7 @@ void RunTest6_1_2(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_6_1_3.cpp b/tests/nexus/test_1_1_6_1_3.cpp index d33777f2b..abefe83ac 100644 --- a/tests/nexus/test_1_1_6_1_3.cpp +++ b/tests/nexus/test_1_1_6_1_3.cpp @@ -112,7 +112,7 @@ void RunTest6_1_3(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); if (aTopology == kTopologyA) diff --git a/tests/nexus/test_1_1_6_1_4.cpp b/tests/nexus/test_1_1_6_1_4.cpp index be3ed506b..c8fbeff4a 100644 --- a/tests/nexus/test_1_1_6_1_4.cpp +++ b/tests/nexus/test_1_1_6_1_4.cpp @@ -121,7 +121,7 @@ void Test6_1_4(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_6_1_5.cpp b/tests/nexus/test_1_1_6_1_5.cpp index a22b50021..4ca688914 100644 --- a/tests/nexus/test_1_1_6_1_5.cpp +++ b/tests/nexus/test_1_1_6_1_5.cpp @@ -112,7 +112,7 @@ void Test6_1_5(void) nexus.AdvanceTime(kStartTime); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Setup the topology without the DUT. Ensure all routers and leader are sending MLE advertisements."); diff --git a/tests/nexus/test_1_1_6_1_6.cpp b/tests/nexus/test_1_1_6_1_6.cpp index c2080ac6e..cd290754d 100644 --- a/tests/nexus/test_1_1_6_1_6.cpp +++ b/tests/nexus/test_1_1_6_1_6.cpp @@ -122,7 +122,7 @@ void RunTest6_1_6(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_6_1_7.cpp b/tests/nexus/test_1_1_6_1_7.cpp index 798b2d04d..8ebef621e 100644 --- a/tests/nexus/test_1_1_6_1_7.cpp +++ b/tests/nexus/test_1_1_6_1_7.cpp @@ -90,7 +90,7 @@ void RunTest6_1_7(const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_6_2_1.cpp b/tests/nexus/test_1_1_6_2_1.cpp index 4f784fc6c..b9d3eb854 100644 --- a/tests/nexus/test_1_1_6_2_1.cpp +++ b/tests/nexus/test_1_1_6_2_1.cpp @@ -89,7 +89,7 @@ void RunTest6_2_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_6_2_2.cpp b/tests/nexus/test_1_1_6_2_2.cpp index 6aac01752..a4c6373ef 100644 --- a/tests/nexus/test_1_1_6_2_2.cpp +++ b/tests/nexus/test_1_1_6_2_2.cpp @@ -124,7 +124,7 @@ void RunTest_6_2_2(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_6_3_1.cpp b/tests/nexus/test_1_1_6_3_1.cpp index 7c1ac95cc..712ced4b4 100644 --- a/tests/nexus/test_1_1_6_3_1.cpp +++ b/tests/nexus/test_1_1_6_3_1.cpp @@ -127,7 +127,7 @@ void RunTest6_3_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); if (aTopology == kTopologyA) diff --git a/tests/nexus/test_1_1_6_3_2.cpp b/tests/nexus/test_1_1_6_3_2.cpp index 088f93ada..8e3a7c832 100644 --- a/tests/nexus/test_1_1_6_3_2.cpp +++ b/tests/nexus/test_1_1_6_3_2.cpp @@ -109,7 +109,7 @@ void RunTest6_3_2(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_6_4_1.cpp b/tests/nexus/test_1_1_6_4_1.cpp index 700d7adaf..ab5889d7e 100644 --- a/tests/nexus/test_1_1_6_4_1.cpp +++ b/tests/nexus/test_1_1_6_4_1.cpp @@ -113,7 +113,7 @@ void RunTest6_4_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); if (aTopology == kTopologyA) { diff --git a/tests/nexus/test_1_1_6_4_2.cpp b/tests/nexus/test_1_1_6_4_2.cpp index 1d42564cf..e2387c9a2 100644 --- a/tests/nexus/test_1_1_6_4_2.cpp +++ b/tests/nexus/test_1_1_6_4_2.cpp @@ -115,7 +115,7 @@ void RunTest6_4_2(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_6_5_1.cpp b/tests/nexus/test_1_1_6_5_1.cpp index 70f68085b..ebc8a4895 100644 --- a/tests/nexus/test_1_1_6_5_1.cpp +++ b/tests/nexus/test_1_1_6_5_1.cpp @@ -114,7 +114,7 @@ void RunTest6_5_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_6_5_2.cpp b/tests/nexus/test_1_1_6_5_2.cpp index 144b8782e..d2dc4f6c1 100644 --- a/tests/nexus/test_1_1_6_5_2.cpp +++ b/tests/nexus/test_1_1_6_5_2.cpp @@ -112,7 +112,7 @@ void RunTest_6_5_2(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); if (aTopology == kTopologyA) diff --git a/tests/nexus/test_1_1_6_5_3.cpp b/tests/nexus/test_1_1_6_5_3.cpp index df3aa352b..dd90196bd 100644 --- a/tests/nexus/test_1_1_6_5_3.cpp +++ b/tests/nexus/test_1_1_6_5_3.cpp @@ -130,7 +130,7 @@ void RunTest6_5_3(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_6_6_1.cpp b/tests/nexus/test_1_1_6_6_1.cpp index 7ad4bbf3b..650626424 100644 --- a/tests/nexus/test_1_1_6_6_1.cpp +++ b/tests/nexus/test_1_1_6_6_1.cpp @@ -110,7 +110,7 @@ void RunTest6_6_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); if (aTopology == kTopologyA) { diff --git a/tests/nexus/test_1_1_6_6_2.cpp b/tests/nexus/test_1_1_6_6_2.cpp index fac5569de..c8e605d24 100644 --- a/tests/nexus/test_1_1_6_6_2.cpp +++ b/tests/nexus/test_1_1_6_6_2.cpp @@ -110,7 +110,7 @@ void RunTest6_6_2(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); if (aTopology == kTopologyA) { diff --git a/tests/nexus/test_1_1_7_1_1.cpp b/tests/nexus/test_1_1_7_1_1.cpp index a9f239a30..8084f5b5c 100644 --- a/tests/nexus/test_1_1_7_1_1.cpp +++ b/tests/nexus/test_1_1_7_1_1.cpp @@ -94,7 +94,7 @@ void Test7_1_1(const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: Leader (DUT) diff --git a/tests/nexus/test_1_1_7_1_2.cpp b/tests/nexus/test_1_1_7_1_2.cpp index d586d2c51..955c6cf18 100644 --- a/tests/nexus/test_1_1_7_1_2.cpp +++ b/tests/nexus/test_1_1_7_1_2.cpp @@ -99,7 +99,7 @@ void Test7_1_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: Leader diff --git a/tests/nexus/test_1_1_7_1_3.cpp b/tests/nexus/test_1_1_7_1_3.cpp index 134a2d13a..fbcf8e891 100644 --- a/tests/nexus/test_1_1_7_1_3.cpp +++ b/tests/nexus/test_1_1_7_1_3.cpp @@ -99,7 +99,7 @@ void Test7_1_3(const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_7_1_4.cpp b/tests/nexus/test_1_1_7_1_4.cpp index 0dc1ec08c..7036493bd 100644 --- a/tests/nexus/test_1_1_7_1_4.cpp +++ b/tests/nexus/test_1_1_7_1_4.cpp @@ -101,7 +101,7 @@ void Test7_1_4(const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_7_1_5.cpp b/tests/nexus/test_1_1_7_1_5.cpp index 11b93b993..373882fe6 100644 --- a/tests/nexus/test_1_1_7_1_5.cpp +++ b/tests/nexus/test_1_1_7_1_5.cpp @@ -82,7 +82,7 @@ void Test7_1_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_7_1_6.cpp b/tests/nexus/test_1_1_7_1_6.cpp index 9da6bb0d7..532c5582f 100644 --- a/tests/nexus/test_1_1_7_1_6.cpp +++ b/tests/nexus/test_1_1_7_1_6.cpp @@ -109,7 +109,7 @@ void Test7_1_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_7_1_7.cpp b/tests/nexus/test_1_1_7_1_7.cpp index fd4f05a24..a51577a02 100644 --- a/tests/nexus/test_1_1_7_1_7.cpp +++ b/tests/nexus/test_1_1_7_1_7.cpp @@ -111,7 +111,7 @@ void Test7_1_7(const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_7_1_8.cpp b/tests/nexus/test_1_1_7_1_8.cpp index d070a6a62..680c5ed40 100644 --- a/tests/nexus/test_1_1_7_1_8.cpp +++ b/tests/nexus/test_1_1_7_1_8.cpp @@ -107,7 +107,7 @@ void Test7_1_8(const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_8_1_1.cpp b/tests/nexus/test_1_1_8_1_1.cpp index 7bb284c77..517da80ab 100644 --- a/tests/nexus/test_1_1_8_1_1.cpp +++ b/tests/nexus/test_1_1_8_1_1.cpp @@ -154,7 +154,7 @@ void Test1_1_8_1_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); // Remove any existing key log file. remove(kKeyLogFilename); diff --git a/tests/nexus/test_1_1_8_1_2.cpp b/tests/nexus/test_1_1_8_1_2.cpp index c672f6b60..095b13217 100644 --- a/tests/nexus/test_1_1_8_1_2.cpp +++ b/tests/nexus/test_1_1_8_1_2.cpp @@ -159,7 +159,7 @@ void Test8_1_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); // Remove any existing key log file. remove(kKeyLogFilename); diff --git a/tests/nexus/test_1_1_8_1_6.cpp b/tests/nexus/test_1_1_8_1_6.cpp index 078f931a3..47c0c522a 100644 --- a/tests/nexus/test_1_1_8_1_6.cpp +++ b/tests/nexus/test_1_1_8_1_6.cpp @@ -154,7 +154,7 @@ void Test1_1_8_1_6(const char *aJsonFileName) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); // Remove any existing key log file. remove(kKeyLogFilename); diff --git a/tests/nexus/test_1_1_8_2_1.cpp b/tests/nexus/test_1_1_8_2_1.cpp index 3d9039405..e29c7b5f4 100644 --- a/tests/nexus/test_1_1_8_2_1.cpp +++ b/tests/nexus/test_1_1_8_2_1.cpp @@ -157,7 +157,7 @@ void Test1_1_8_2_1(const char *aJsonFileName) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: All"); diff --git a/tests/nexus/test_1_1_8_2_2.cpp b/tests/nexus/test_1_1_8_2_2.cpp index deec4cd5c..56431a4fc 100644 --- a/tests/nexus/test_1_1_8_2_2.cpp +++ b/tests/nexus/test_1_1_8_2_2.cpp @@ -157,7 +157,7 @@ void Test8_2_2(const char *aJsonFileName) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); #if OPENTHREAD_CONFIG_MBEDTLS_PROVIDES_SSL_KEY_EXPORT remove("test_1_1_8_2_2.keys"); diff --git a/tests/nexus/test_1_1_8_3_1.cpp b/tests/nexus/test_1_1_8_3_1.cpp index 2b1608a3e..34329ba27 100644 --- a/tests/nexus/test_1_1_8_3_1.cpp +++ b/tests/nexus/test_1_1_8_3_1.cpp @@ -87,7 +87,7 @@ void Test_1_1_8_3_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_1.cpp b/tests/nexus/test_1_1_9_2_1.cpp index 3acf9f922..ab8aeaa71 100644 --- a/tests/nexus/test_1_1_9_2_1.cpp +++ b/tests/nexus/test_1_1_9_2_1.cpp @@ -99,7 +99,7 @@ void RunTest9_2_1(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_10.cpp b/tests/nexus/test_1_1_9_2_10.cpp index c0d80dac9..666865aa1 100644 --- a/tests/nexus/test_1_1_9_2_10.cpp +++ b/tests/nexus/test_1_1_9_2_10.cpp @@ -170,7 +170,7 @@ void Test9_2_10(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_11.cpp b/tests/nexus/test_1_1_9_2_11.cpp index 8a830183c..37fc1c0d3 100644 --- a/tests/nexus/test_1_1_9_2_11.cpp +++ b/tests/nexus/test_1_1_9_2_11.cpp @@ -167,7 +167,7 @@ void Test9_2_11(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_12.cpp b/tests/nexus/test_1_1_9_2_12.cpp index 50eaaa8bb..ef0e09a45 100644 --- a/tests/nexus/test_1_1_9_2_12.cpp +++ b/tests/nexus/test_1_1_9_2_12.cpp @@ -122,7 +122,7 @@ void Test9_2_12(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** Use AllowList feature to specify links between nodes. */ leader2.AllowList(med1); diff --git a/tests/nexus/test_1_1_9_2_13.cpp b/tests/nexus/test_1_1_9_2_13.cpp index 7fd512a51..3017b02a6 100644 --- a/tests/nexus/test_1_1_9_2_13.cpp +++ b/tests/nexus/test_1_1_9_2_13.cpp @@ -152,7 +152,7 @@ void Test9_2_13(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 1: Form topology and start a constant ICMPv6 Echo Request from Leader_2 to SED_2."); diff --git a/tests/nexus/test_1_1_9_2_14.cpp b/tests/nexus/test_1_1_9_2_14.cpp index 852bcea57..ed3ad12ab 100644 --- a/tests/nexus/test_1_1_9_2_14.cpp +++ b/tests/nexus/test_1_1_9_2_14.cpp @@ -106,7 +106,7 @@ void Test9_2_14(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_15.cpp b/tests/nexus/test_1_1_9_2_15.cpp index 09e8fd7cb..2a6d69672 100644 --- a/tests/nexus/test_1_1_9_2_15.cpp +++ b/tests/nexus/test_1_1_9_2_15.cpp @@ -203,7 +203,7 @@ void Test9_2_15(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Commissioner, Leader, Router_1"); diff --git a/tests/nexus/test_1_1_9_2_16.cpp b/tests/nexus/test_1_1_9_2_16.cpp index f1452cc7b..5470ab8ca 100644 --- a/tests/nexus/test_1_1_9_2_16.cpp +++ b/tests/nexus/test_1_1_9_2_16.cpp @@ -189,7 +189,7 @@ void Test9_2_16(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Commissioner, Leader, Router_1"); diff --git a/tests/nexus/test_1_1_9_2_17.cpp b/tests/nexus/test_1_1_9_2_17.cpp index a4522cbae..e6e808d64 100644 --- a/tests/nexus/test_1_1_9_2_17.cpp +++ b/tests/nexus/test_1_1_9_2_17.cpp @@ -140,7 +140,7 @@ void Test9_2_17(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_18.cpp b/tests/nexus/test_1_1_9_2_18.cpp index 7271f354b..fb9063aa1 100644 --- a/tests/nexus/test_1_1_9_2_18.cpp +++ b/tests/nexus/test_1_1_9_2_18.cpp @@ -142,7 +142,7 @@ void Test9_2_18(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_19.cpp b/tests/nexus/test_1_1_9_2_19.cpp index f1a3967a2..ba25ae2e6 100644 --- a/tests/nexus/test_1_1_9_2_19.cpp +++ b/tests/nexus/test_1_1_9_2_19.cpp @@ -120,7 +120,7 @@ void RunTest9_2_19(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_9_2_2.cpp b/tests/nexus/test_1_1_9_2_2.cpp index 822f186fc..b0770e1c0 100644 --- a/tests/nexus/test_1_1_9_2_2.cpp +++ b/tests/nexus/test_1_1_9_2_2.cpp @@ -99,7 +99,7 @@ void Test9_2_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All diff --git a/tests/nexus/test_1_1_9_2_3.cpp b/tests/nexus/test_1_1_9_2_3.cpp index f0230eb98..bfbec7f73 100644 --- a/tests/nexus/test_1_1_9_2_3.cpp +++ b/tests/nexus/test_1_1_9_2_3.cpp @@ -101,7 +101,7 @@ void RunTest9_2_3(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_4.cpp b/tests/nexus/test_1_1_9_2_4.cpp index 8bf5ae29b..3a0411c9a 100644 --- a/tests/nexus/test_1_1_9_2_4.cpp +++ b/tests/nexus/test_1_1_9_2_4.cpp @@ -261,7 +261,7 @@ void RunTest9_2_4(Topology aTopology, const char *aJsonFile) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_5.cpp b/tests/nexus/test_1_1_9_2_5.cpp index 5c27cc0e5..3396ac2ba 100644 --- a/tests/nexus/test_1_1_9_2_5.cpp +++ b/tests/nexus/test_1_1_9_2_5.cpp @@ -113,7 +113,7 @@ void Test9_2_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_6.cpp b/tests/nexus/test_1_1_9_2_6.cpp index cc5918c0c..e5452dea1 100644 --- a/tests/nexus/test_1_1_9_2_6.cpp +++ b/tests/nexus/test_1_1_9_2_6.cpp @@ -139,7 +139,7 @@ void Test9_2_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_7.cpp b/tests/nexus/test_1_1_9_2_7.cpp index a18274c04..f0f476ae3 100644 --- a/tests/nexus/test_1_1_9_2_7.cpp +++ b/tests/nexus/test_1_1_9_2_7.cpp @@ -154,7 +154,7 @@ void Test9_2_7(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_8.cpp b/tests/nexus/test_1_1_9_2_8.cpp index 8c3711ff9..efe22dc63 100644 --- a/tests/nexus/test_1_1_9_2_8.cpp +++ b/tests/nexus/test_1_1_9_2_8.cpp @@ -147,7 +147,7 @@ void Test9_2_8(void) med1.SetName("MED_1"); sed1.SetName("SED_1"); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_1_9_2_9.cpp b/tests/nexus/test_1_1_9_2_9.cpp index b2f2a5747..ed99a9928 100644 --- a/tests/nexus/test_1_1_9_2_9.cpp +++ b/tests/nexus/test_1_1_9_2_9.cpp @@ -209,7 +209,7 @@ void Test9_2_9(void) router2.Get().SetNetworkIdTimeout(70); router1.Get().SetNetworkIdTimeout(120); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_2_BBR_TC_1.cpp b/tests/nexus/test_1_2_BBR_TC_1.cpp index c9e6070ee..1a02a5883 100644 --- a/tests/nexus/test_1_2_BBR_TC_1.cpp +++ b/tests/nexus/test_1_2_BBR_TC_1.cpp @@ -148,7 +148,7 @@ void Test_1_2_BBR_TC_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation - Leader, Router"); diff --git a/tests/nexus/test_1_2_BBR_TC_2.cpp b/tests/nexus/test_1_2_BBR_TC_2.cpp index 05744fee7..3d7b5c1d3 100644 --- a/tests/nexus/test_1_2_BBR_TC_2.cpp +++ b/tests/nexus/test_1_2_BBR_TC_2.cpp @@ -102,7 +102,7 @@ void Test_1_2_BBR_TC_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_BBR_TC_3.cpp b/tests/nexus/test_1_2_BBR_TC_3.cpp index 25123d50e..a889afbe3 100644 --- a/tests/nexus/test_1_2_BBR_TC_3.cpp +++ b/tests/nexus/test_1_2_BBR_TC_3.cpp @@ -114,7 +114,7 @@ void TestBbrTc3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation - BR_1"); diff --git a/tests/nexus/test_1_2_LP_5_2_1.cpp b/tests/nexus/test_1_2_LP_5_2_1.cpp index 8dfea698e..c8a9179a7 100644 --- a/tests/nexus/test_1_2_LP_5_2_1.cpp +++ b/tests/nexus/test_1_2_LP_5_2_1.cpp @@ -146,7 +146,7 @@ void Test1_2_LP_5_2_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1: All Devices diff --git a/tests/nexus/test_1_2_LP_5_3_1.cpp b/tests/nexus/test_1_2_LP_5_3_1.cpp index 4edcb1a8d..2a062962b 100644 --- a/tests/nexus/test_1_2_LP_5_3_1.cpp +++ b/tests/nexus/test_1_2_LP_5_3_1.cpp @@ -100,7 +100,7 @@ void Test1_2_LP_5_3_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: All"); diff --git a/tests/nexus/test_1_2_LP_5_3_2.cpp b/tests/nexus/test_1_2_LP_5_3_2.cpp index 42b0476a6..b95c4c2fe 100644 --- a/tests/nexus/test_1_2_LP_5_3_2.cpp +++ b/tests/nexus/test_1_2_LP_5_3_2.cpp @@ -186,7 +186,7 @@ void Test1_2_LP_5_3_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0: SSED_1 diff --git a/tests/nexus/test_1_2_LP_5_3_3.cpp b/tests/nexus/test_1_2_LP_5_3_3.cpp index 343708e00..e068879ab 100644 --- a/tests/nexus/test_1_2_LP_5_3_3.cpp +++ b/tests/nexus/test_1_2_LP_5_3_3.cpp @@ -129,7 +129,7 @@ void Test1_2_LP_5_3_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0: SSED_1 diff --git a/tests/nexus/test_1_2_LP_5_3_4.cpp b/tests/nexus/test_1_2_LP_5_3_4.cpp index 3518340c8..f5a0b510e 100644 --- a/tests/nexus/test_1_2_LP_5_3_4.cpp +++ b/tests/nexus/test_1_2_LP_5_3_4.cpp @@ -96,7 +96,7 @@ void Test1_2_LP_5_3_4(void) router1.SetName("ROUTER_1"); ssed1.SetName("SSED_1"); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: SSED_1"); diff --git a/tests/nexus/test_1_2_LP_5_3_5.cpp b/tests/nexus/test_1_2_LP_5_3_5.cpp index 868248b8c..48118e412 100644 --- a/tests/nexus/test_1_2_LP_5_3_5.cpp +++ b/tests/nexus/test_1_2_LP_5_3_5.cpp @@ -141,7 +141,7 @@ void Test1_2_LP_5_3_5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: SSED_1-6"); diff --git a/tests/nexus/test_1_2_LP_5_3_6.cpp b/tests/nexus/test_1_2_LP_5_3_6.cpp index 00413e178..83138b5e9 100644 --- a/tests/nexus/test_1_2_LP_5_3_6.cpp +++ b/tests/nexus/test_1_2_LP_5_3_6.cpp @@ -120,7 +120,7 @@ void Test1_2_LP_5_3_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0: SSED_1 diff --git a/tests/nexus/test_1_2_LP_5_3_7.cpp b/tests/nexus/test_1_2_LP_5_3_7.cpp index 3f04cc411..898ea9e4e 100644 --- a/tests/nexus/test_1_2_LP_5_3_7.cpp +++ b/tests/nexus/test_1_2_LP_5_3_7.cpp @@ -116,7 +116,7 @@ void Test1_2_LP_5_3_7(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: SSED_1: Preconditions: Set CSL Synchronized Timeout = 10s. Set CSL Period = 500ms."); diff --git a/tests/nexus/test_1_2_LP_5_3_8.cpp b/tests/nexus/test_1_2_LP_5_3_8.cpp index 209b888f6..91862516a 100644 --- a/tests/nexus/test_1_2_LP_5_3_8.cpp +++ b/tests/nexus/test_1_2_LP_5_3_8.cpp @@ -151,7 +151,7 @@ void Test5_3_8(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: SSED_1"); diff --git a/tests/nexus/test_1_2_LP_7_1_1.cpp b/tests/nexus/test_1_2_LP_7_1_1.cpp index e38c8d1ac..444ca4fc9 100644 --- a/tests/nexus/test_1_2_LP_7_1_1.cpp +++ b/tests/nexus/test_1_2_LP_7_1_1.cpp @@ -143,7 +143,7 @@ void Test1_2_LP_7_1_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 1: Topology formation: DUT, SED_1, SSED_1."); diff --git a/tests/nexus/test_1_2_LP_7_1_2.cpp b/tests/nexus/test_1_2_LP_7_1_2.cpp index bcd35dbb4..27ad2d581 100644 --- a/tests/nexus/test_1_2_LP_7_1_2.cpp +++ b/tests/nexus/test_1_2_LP_7_1_2.cpp @@ -134,7 +134,7 @@ void Test1_2_LP_7_1_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Topology formation: DUT, SED_1, SSED_1."); diff --git a/tests/nexus/test_1_2_LP_7_2_1.cpp b/tests/nexus/test_1_2_LP_7_2_1.cpp index 0bbe3480c..52d3c0d9d 100644 --- a/tests/nexus/test_1_2_LP_7_2_1.cpp +++ b/tests/nexus/test_1_2_LP_7_2_1.cpp @@ -172,7 +172,7 @@ void Test1_2_LP_7_2_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0: SED_1 diff --git a/tests/nexus/test_1_2_LP_7_2_2.cpp b/tests/nexus/test_1_2_LP_7_2_2.cpp index a0f43f7de..ff455de4e 100644 --- a/tests/nexus/test_1_2_LP_7_2_2.cpp +++ b/tests/nexus/test_1_2_LP_7_2_2.cpp @@ -173,7 +173,7 @@ void Test1_2_LP_7_2_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); CallbackContext context; diff --git a/tests/nexus/test_1_2_MATN_TC_1.cpp b/tests/nexus/test_1_2_MATN_TC_1.cpp index 604c84e8a..9a5c91ff1 100644 --- a/tests/nexus/test_1_2_MATN_TC_1.cpp +++ b/tests/nexus/test_1_2_MATN_TC_1.cpp @@ -124,7 +124,7 @@ void TestMatnTc1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: Topology - BR_1 (DUT), Router"); diff --git a/tests/nexus/test_1_2_MATN_TC_10.cpp b/tests/nexus/test_1_2_MATN_TC_10.cpp index f3876766b..74ed8c3ee 100644 --- a/tests/nexus/test_1_2_MATN_TC_10.cpp +++ b/tests/nexus/test_1_2_MATN_TC_10.cpp @@ -121,7 +121,7 @@ void TestMatnTc10(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation – BR_1, ROUTER, BR_2 (DUT)"); diff --git a/tests/nexus/test_1_2_MATN_TC_12.cpp b/tests/nexus/test_1_2_MATN_TC_12.cpp index 1fe069709..39130ea55 100644 --- a/tests/nexus/test_1_2_MATN_TC_12.cpp +++ b/tests/nexus/test_1_2_MATN_TC_12.cpp @@ -121,7 +121,7 @@ void TestMatnTc12(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: Topology formation – BR_1 (DUT), Router"); diff --git a/tests/nexus/test_1_2_MATN_TC_15.cpp b/tests/nexus/test_1_2_MATN_TC_15.cpp index dfac02159..9d6da581b 100644 --- a/tests/nexus/test_1_2_MATN_TC_15.cpp +++ b/tests/nexus/test_1_2_MATN_TC_15.cpp @@ -97,7 +97,7 @@ void TestMatnTc15(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation – BR_1, BR_2, Router. Topology formation - TD (DUT). Boot the DUT. Configure the " diff --git a/tests/nexus/test_1_2_MATN_TC_16.cpp b/tests/nexus/test_1_2_MATN_TC_16.cpp index 930d35714..6fa10a968 100644 --- a/tests/nexus/test_1_2_MATN_TC_16.cpp +++ b/tests/nexus/test_1_2_MATN_TC_16.cpp @@ -132,7 +132,7 @@ void TestMatnTc16(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_MATN_TC_19.cpp b/tests/nexus/test_1_2_MATN_TC_19.cpp index 675f4fee6..5d6cbe893 100644 --- a/tests/nexus/test_1_2_MATN_TC_19.cpp +++ b/tests/nexus/test_1_2_MATN_TC_19.cpp @@ -136,7 +136,7 @@ void TestMatnTc19(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: Topology formation – BR_1, BR_2, Router, MTD"); diff --git a/tests/nexus/test_1_2_MATN_TC_2.cpp b/tests/nexus/test_1_2_MATN_TC_2.cpp index dd6a4e90d..ee20b4c58 100644 --- a/tests/nexus/test_1_2_MATN_TC_2.cpp +++ b/tests/nexus/test_1_2_MATN_TC_2.cpp @@ -115,7 +115,7 @@ void TestMatnTc2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_MATN_TC_20.cpp b/tests/nexus/test_1_2_MATN_TC_20.cpp index 10927b891..dc204ac19 100644 --- a/tests/nexus/test_1_2_MATN_TC_20.cpp +++ b/tests/nexus/test_1_2_MATN_TC_20.cpp @@ -101,7 +101,7 @@ void TestMatnTc20(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: Topology formation - BR_1, BR_2. Topology formation - Router (DUT). The DUT is booted and added to " "the network. Topology formation - MED."); diff --git a/tests/nexus/test_1_2_MATN_TC_21.cpp b/tests/nexus/test_1_2_MATN_TC_21.cpp index 2297cc939..b1e170202 100644 --- a/tests/nexus/test_1_2_MATN_TC_21.cpp +++ b/tests/nexus/test_1_2_MATN_TC_21.cpp @@ -165,7 +165,7 @@ void TestMatnTc21(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_MATN_TC_22.cpp b/tests/nexus/test_1_2_MATN_TC_22.cpp index eb3d3e6de..eaf8623a1 100644 --- a/tests/nexus/test_1_2_MATN_TC_22.cpp +++ b/tests/nexus/test_1_2_MATN_TC_22.cpp @@ -111,7 +111,7 @@ void TestMatnTc22(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_MATN_TC_23.cpp b/tests/nexus/test_1_2_MATN_TC_23.cpp index c9919e780..7b3873546 100644 --- a/tests/nexus/test_1_2_MATN_TC_23.cpp +++ b/tests/nexus/test_1_2_MATN_TC_23.cpp @@ -97,7 +97,7 @@ void TestMatnTc23(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_MATN_TC_26.cpp b/tests/nexus/test_1_2_MATN_TC_26.cpp index c0d22df6e..d7f317f9d 100644 --- a/tests/nexus/test_1_2_MATN_TC_26.cpp +++ b/tests/nexus/test_1_2_MATN_TC_26.cpp @@ -101,7 +101,7 @@ void TestMatnTc26(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation – BR_1. Topology formation – TD (DUT)."); diff --git a/tests/nexus/test_1_2_MATN_TC_3.cpp b/tests/nexus/test_1_2_MATN_TC_3.cpp index 606e6b3b2..f9382b949 100644 --- a/tests/nexus/test_1_2_MATN_TC_3.cpp +++ b/tests/nexus/test_1_2_MATN_TC_3.cpp @@ -121,7 +121,7 @@ void TestMatnTc3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation - DUT, BR_2, Router"); diff --git a/tests/nexus/test_1_2_MATN_TC_4.cpp b/tests/nexus/test_1_2_MATN_TC_4.cpp index 57fd18212..561b4b214 100644 --- a/tests/nexus/test_1_2_MATN_TC_4.cpp +++ b/tests/nexus/test_1_2_MATN_TC_4.cpp @@ -126,7 +126,7 @@ void Test1_2_MATN_TC_4(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("Step 0: Topology formation - BR_1 (DUT). Boot DUT. Configure the MLR timeout value of the DUT to be " "MLR_TIMEOUT_MIN seconds."); diff --git a/tests/nexus/test_1_2_MATN_TC_5.cpp b/tests/nexus/test_1_2_MATN_TC_5.cpp index 002947237..03cd95a57 100644 --- a/tests/nexus/test_1_2_MATN_TC_5.cpp +++ b/tests/nexus/test_1_2_MATN_TC_5.cpp @@ -127,7 +127,7 @@ void TestMatnTc5(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_2_MATN_TC_7.cpp b/tests/nexus/test_1_2_MATN_TC_7.cpp index 9c22b0d44..197e8ff26 100644 --- a/tests/nexus/test_1_2_MATN_TC_7.cpp +++ b/tests/nexus/test_1_2_MATN_TC_7.cpp @@ -132,7 +132,7 @@ void TestMatnTc7(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation - BR_1, BR_2, ROUTER"); diff --git a/tests/nexus/test_1_2_MATN_TC_9.cpp b/tests/nexus/test_1_2_MATN_TC_9.cpp index 4416503cd..58e3f8b4b 100644 --- a/tests/nexus/test_1_2_MATN_TC_9.cpp +++ b/tests/nexus/test_1_2_MATN_TC_9.cpp @@ -103,7 +103,7 @@ void TestMatnTc9(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Topology formation – BR_1, Router, BR_2 (DUT)"); diff --git a/tests/nexus/test_1_3_DBR_TC_1.cpp b/tests/nexus/test_1_3_DBR_TC_1.cpp index 48c4ceeaf..5cc4fc264 100644 --- a/tests/nexus/test_1_3_DBR_TC_1.cpp +++ b/tests/nexus/test_1_3_DBR_TC_1.cpp @@ -104,7 +104,7 @@ void Test_1_3_DBR_TC_1(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Device: Eth 1, ED 1 Description (DBR-1.1): Enable."); diff --git a/tests/nexus/test_1_3_DBR_TC_10.cpp b/tests/nexus/test_1_3_DBR_TC_10.cpp index c256bb29c..2979f22ea 100644 --- a/tests/nexus/test_1_3_DBR_TC_10.cpp +++ b/tests/nexus/test_1_3_DBR_TC_10.cpp @@ -149,7 +149,7 @@ void Test_1_3_DBR_TC_10(const char *aJsonFileName) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 0 diff --git a/tests/nexus/test_1_3_DBR_TC_2.cpp b/tests/nexus/test_1_3_DBR_TC_2.cpp index b911e4d70..c74e8fca2 100644 --- a/tests/nexus/test_1_3_DBR_TC_2.cpp +++ b/tests/nexus/test_1_3_DBR_TC_2.cpp @@ -111,7 +111,7 @@ void Test_1_3_DBR_TC_2(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 1: Device: Eth 1, BR 2 Description (DBR-1.2): Form topology. Wait for BR_2 to..."); diff --git a/tests/nexus/test_1_3_DBR_TC_3.cpp b/tests/nexus/test_1_3_DBR_TC_3.cpp index 001802ece..1e5a46e50 100644 --- a/tests/nexus/test_1_3_DBR_TC_3.cpp +++ b/tests/nexus/test_1_3_DBR_TC_3.cpp @@ -105,7 +105,7 @@ void Test_1_3_DBR_TC_3(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); /** * Step 1 diff --git a/tests/nexus/test_1_3_DBR_TC_6.cpp b/tests/nexus/test_1_3_DBR_TC_6.cpp index 023bca07d..8564ad110 100644 --- a/tests/nexus/test_1_3_DBR_TC_6.cpp +++ b/tests/nexus/test_1_3_DBR_TC_6.cpp @@ -121,7 +121,7 @@ void Test_1_3_DBR_TC_6(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Device: Eth 1 Description (DBR-1.6): Harness configures Ethernet link with an on-link IPv6 GUA prefix " diff --git a/tests/nexus/test_1_3_DBR_TC_7A.cpp b/tests/nexus/test_1_3_DBR_TC_7A.cpp index 77f9b8505..0a73784d7 100644 --- a/tests/nexus/test_1_3_DBR_TC_7A.cpp +++ b/tests/nexus/test_1_3_DBR_TC_7A.cpp @@ -120,7 +120,7 @@ void Test_1_3_DBR_TC_7A(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Device: Eth 1 Description (DBR-1.7a): Enable."); diff --git a/tests/nexus/test_1_3_DBR_TC_7B.cpp b/tests/nexus/test_1_3_DBR_TC_7B.cpp index fe732e408..1f4ba0677 100644 --- a/tests/nexus/test_1_3_DBR_TC_7B.cpp +++ b/tests/nexus/test_1_3_DBR_TC_7B.cpp @@ -120,7 +120,7 @@ void Test_1_3_DBR_TC_7B(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Device: Eth 1 Description (DBR-1.7b): Enable."); diff --git a/tests/nexus/test_1_3_DBR_TC_7C.cpp b/tests/nexus/test_1_3_DBR_TC_7C.cpp index 027720460..886c5d360 100644 --- a/tests/nexus/test_1_3_DBR_TC_7C.cpp +++ b/tests/nexus/test_1_3_DBR_TC_7C.cpp @@ -130,7 +130,7 @@ void Test_1_3_DBR_TC_7C(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); Log("Step 0: Device: Eth 1 Description (DBR-1.7c): Enable."); diff --git a/tests/nexus/test_1_3_DBR_TC_8.cpp b/tests/nexus/test_1_3_DBR_TC_8.cpp index 807ad9f43..4137cb201 100644 --- a/tests/nexus/test_1_3_DBR_TC_8.cpp +++ b/tests/nexus/test_1_3_DBR_TC_8.cpp @@ -235,7 +235,7 @@ void Test_1_3_DBR_TC_8(void) nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); /** diff --git a/tests/nexus/test_1_3_SRP_TC_1.cpp b/tests/nexus/test_1_3_SRP_TC_1.cpp index 69f5273d0..7f2de2745 100644 --- a/tests/nexus/test_1_3_SRP_TC_1.cpp +++ b/tests/nexus/test_1_3_SRP_TC_1.cpp @@ -117,7 +117,7 @@ void Test_1_3_SRP_TC_1(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_1_3_SRP_TC_2.cpp b/tests/nexus/test_1_3_SRP_TC_2.cpp index 1da9948f4..9234c3107 100644 --- a/tests/nexus/test_1_3_SRP_TC_2.cpp +++ b/tests/nexus/test_1_3_SRP_TC_2.cpp @@ -122,7 +122,7 @@ void Test_1_3_SRP_TC_2(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_1_3_SRP_TC_3.cpp b/tests/nexus/test_1_3_SRP_TC_3.cpp index c5e97a885..d72aa47fe 100644 --- a/tests/nexus/test_1_3_SRP_TC_3.cpp +++ b/tests/nexus/test_1_3_SRP_TC_3.cpp @@ -118,7 +118,7 @@ void Test_1_3_SRP_TC_3(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_1_3_SRP_TC_4.cpp b/tests/nexus/test_1_3_SRP_TC_4.cpp index a961b0f76..5dbf2a9cf 100644 --- a/tests/nexus/test_1_3_SRP_TC_4.cpp +++ b/tests/nexus/test_1_3_SRP_TC_4.cpp @@ -159,7 +159,7 @@ void Test_1_3_SRP_TC_4(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_1_3_SRP_TC_5.cpp b/tests/nexus/test_1_3_SRP_TC_5.cpp index e52aa7325..d32cb9e15 100644 --- a/tests/nexus/test_1_3_SRP_TC_5.cpp +++ b/tests/nexus/test_1_3_SRP_TC_5.cpp @@ -110,7 +110,7 @@ void Test_1_3_SRP_TC_5(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_1_3_SRP_TC_6.cpp b/tests/nexus/test_1_3_SRP_TC_6.cpp index 29d1d3fe9..8c577f45e 100644 --- a/tests/nexus/test_1_3_SRP_TC_6.cpp +++ b/tests/nexus/test_1_3_SRP_TC_6.cpp @@ -116,7 +116,7 @@ void Test_1_3_SRP_TC_6(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_1_3_SRP_TC_8.cpp b/tests/nexus/test_1_3_SRP_TC_8.cpp index 5b284e759..364d8899b 100644 --- a/tests/nexus/test_1_3_SRP_TC_8.cpp +++ b/tests/nexus/test_1_3_SRP_TC_8.cpp @@ -117,7 +117,7 @@ void Test_1_3_SRP_TC_8(const char *aJsonFileName) br1.Form(); nexus.AdvanceTime(0); - Instance::SetLogLevel(kLogLevelNote); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNote)); Log("---------------------------------------------------------------------------------------"); diff --git a/tests/nexus/test_border_admitter.cpp b/tests/nexus/test_border_admitter.cpp index 41fcae238..729ea0377 100644 --- a/tests/nexus/test_border_admitter.cpp +++ b/tests/nexus/test_border_admitter.cpp @@ -60,7 +60,7 @@ void TestBorderAdmitterPrimeSelection(void) nexus.AdvanceTime(0); - leader.GetInstance().SetLogLevel(kLogLevel); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevel)); // Form the topology. diff --git a/tests/nexus/test_form_join.cpp b/tests/nexus/test_form_join.cpp index 6973afd24..f310bd94c 100644 --- a/tests/nexus/test_form_join.cpp +++ b/tests/nexus/test_form_join.cpp @@ -52,10 +52,7 @@ void TestFormJoin(void) nexus.AdvanceTime(0); - for (Node &node : nexus.GetNodes()) - { - node.GetInstance().SetLogLevel(kLogLevelInfo); - } + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); Log("---------------------------------------------------------------------------------------"); Log("Form network"); diff --git a/tests/nexus/test_mle_blocking_downgrade.cpp b/tests/nexus/test_mle_blocking_downgrade.cpp index ac314f238..f52f381ae 100644 --- a/tests/nexus/test_mle_blocking_downgrade.cpp +++ b/tests/nexus/test_mle_blocking_downgrade.cpp @@ -61,10 +61,7 @@ void TestMleBlockingDowngrade(void) nexus.AdvanceTime(0); - for (Node &node : nexus.GetNodes()) - { - node.GetInstance().SetLogLevel(kLogLevelNone); - } + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelNone)); Log("---------------------------------------------------------------------------------------"); Log("Form initial topology"); diff --git a/tests/nexus/test_nat64_translator.cpp b/tests/nexus/test_nat64_translator.cpp index e1ab842b9..df5aa67bc 100644 --- a/tests/nexus/test_nat64_translator.cpp +++ b/tests/nexus/test_nat64_translator.cpp @@ -65,7 +65,7 @@ void TestNat64StateChanges(void) nexus.AdvanceTime(50 * Time::kOneSecondInMsec); VerifyOrQuit(node.Get().IsLeader()); - node.Get().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); SuccessOrQuit(node.Get().RegisterCallback(HandleNotifierEvent, nullptr)); @@ -448,7 +448,7 @@ void TestNat64Mapping(void) nexus.AdvanceTime(50 * Time::kOneSecondInMsec); VerifyOrQuit(node.Get().IsLeader()); - node.Get().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Log("Enable NAT64 translator"); @@ -705,7 +705,7 @@ void TestNat64CidrAddressReuse(const char *aCidr) nexus.AdvanceTime(50 * Time::kOneSecondInMsec); VerifyOrQuit(node.Get().IsLeader()); - node.Get().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Log("Enable NAT64 translator"); @@ -872,7 +872,7 @@ void TestNat64Evict(void) nexus.AdvanceTime(50 * Time::kOneSecondInMsec); VerifyOrQuit(node.Get().IsLeader()); - node.Get().SetLogLevel(kLogLevelInfo); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Log("Enable NAT64 translator"); diff --git a/tests/nexus/test_trel.cpp b/tests/nexus/test_trel.cpp index 0046d0846..8b45539b2 100644 --- a/tests/nexus/test_trel.cpp +++ b/tests/nexus/test_trel.cpp @@ -63,9 +63,10 @@ void TestTrelBasic(void) nexus.AdvanceTime(0); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelWarn)); + for (Node &node : nexus.GetNodes()) { - node.GetInstance().SetLogLevel(kLogLevelWarn); SuccessOrQuit(node.Get().SetEnabled(true, kInfraIfIndex)); } @@ -179,7 +180,7 @@ void TestTrelUserDisableReenable(void) nexus.AdvanceTime(0); - node.GetInstance().SetLogLevel(kLogLevelWarn); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelWarn)); SuccessOrQuit(node.Get().SetEnabled(true, kInfraIfIndex)); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -243,9 +244,10 @@ void TestTrelDelayedMdnsStartAndPeerRemovalDelay(void) nexus.AdvanceTime(0); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelWarn)); + for (Node &node : nexus.GetNodes()) { - node.GetInstance().SetLogLevel(kLogLevelWarn); VerifyOrQuit(!node.Get().IsEnabled()); } @@ -441,9 +443,10 @@ void TestServiceNameConflict(void) nexus.AdvanceTime(0); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelWarn)); + for (Node &node : nexus.GetNodes()) { - node.GetInstance().SetLogLevel(kLogLevelWarn); VerifyOrQuit(!node.Get().IsEnabled()); } @@ -525,9 +528,10 @@ void TestHostAddressChange(void) nexus.AdvanceTime(0); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelWarn)); + for (Node &node : nexus.GetNodes()) { - node.GetInstance().SetLogLevel(kLogLevelWarn); VerifyOrQuit(!node.Get().IsEnabled()); } @@ -659,9 +663,10 @@ void TestMultiServiceSameHost(void) nexus.AdvanceTime(0); + SuccessOrQuit(Instance::SetGlobalLogLevel(kLogLevelInfo)); + for (Node &nodeEntry : nexus.GetNodes()) { - nodeEntry.GetInstance().SetLogLevel(kLogLevelInfo); VerifyOrQuit(!nodeEntry.Get().IsEnabled()); }