From 9df86e328cd58c53ef9e04f1b283929f175d0c3e Mon Sep 17 00:00:00 2001 From: Daniel Adam Date: Wed, 11 Sep 2024 20:14:18 +0200 Subject: [PATCH] Add dps log component If custom DPS logging function is not configured then use oc log with the dps log component --- .github/workflows/build.yml | 10 +-- .github/workflows/check-format.yml | 8 +- .github/workflows/cmake-windows.yml | 10 +-- .github/workflows/ghcr-check.yml | 2 + .github/workflows/plgd-device-tests.yml | 8 +- .github/workflows/plgd-hub-tests.yml | 8 +- .github/workflows/static-analysis.yml | 10 +-- api/oc_log.c | 4 + .../device-provisioning-client/plgd_dps_log.c | 48 ----------- .../plgd_dps_log_internal.h | 78 ++++------------- api/plgd/unittest/plgd_dps_log.cpp | 83 ++++--------------- docker/apps/Dockerfile.dps-cloud-server-debug | 1 + include/oc_log.h | 4 + include/plgd/plgd_dps.h | 32 +------ 14 files changed, 76 insertions(+), 230 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2bff53872..2b6303b34e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,11 @@ concurrency: # Controls when the action will run. on: - # push: - # branches: - # - master - # pull_request: - # types: [opened, synchronize, reopened] + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 6551e54734..1004fa60b4 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -9,10 +9,10 @@ concurrency: # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - # push: - # branches: [master] - # pull_request: - # branches: [master] + push: + branches: [master] + pull_request: + branches: [master] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/cmake-windows.yml b/.github/workflows/cmake-windows.yml index 73af4d12e1..78c6c89cb8 100644 --- a/.github/workflows/cmake-windows.yml +++ b/.github/workflows/cmake-windows.yml @@ -6,11 +6,11 @@ concurrency: # Controls when the action will run. on: - # push: - # branches: - # - master - # pull_request: - # types: [opened, synchronize, reopened] + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/ghcr-check.yml b/.github/workflows/ghcr-check.yml index efaefba1c1..1955b10a91 100644 --- a/.github/workflows/ghcr-check.yml +++ b/.github/workflows/ghcr-check.yml @@ -16,6 +16,8 @@ on: - cloud-server-debug - cloud-server-discovery-resource-observable - cloud-server-discovery-resource-observable-debug + - dps-cloud-server + - dps-cloud-server-debug jobs: check_package: name: Check released packages diff --git a/.github/workflows/plgd-device-tests.yml b/.github/workflows/plgd-device-tests.yml index d0ea77fca6..4262527b20 100644 --- a/.github/workflows/plgd-device-tests.yml +++ b/.github/workflows/plgd-device-tests.yml @@ -11,10 +11,10 @@ concurrency: on: # Triggers the workflow on push or pull request events but only for the master branch - # push: - # branches: [master] - # pull_request: - # branches: [master] + push: + branches: [master] + pull_request: + branches: [master] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/plgd-hub-tests.yml b/.github/workflows/plgd-hub-tests.yml index 1d32abf6f8..c008660ea7 100644 --- a/.github/workflows/plgd-hub-tests.yml +++ b/.github/workflows/plgd-hub-tests.yml @@ -11,10 +11,10 @@ concurrency: on: # Triggers the workflow on push or pull request events but only for the master branch - # push: - # branches: [master] - # pull_request: - # branches: [master] + push: + branches: [master] + pull_request: + branches: [master] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b79c97cfd5..f62c5e6818 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -5,11 +5,11 @@ concurrency: cancel-in-progress: ${{ github.ref_name != 'master' }} on: - # push: - # branches: - # - master - # pull_request: - # types: [opened, synchronize, reopened] + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/api/oc_log.c b/api/oc_log.c index 6679525bff..5317cf5057 100644 --- a/api/oc_log.c +++ b/api/oc_log.c @@ -96,6 +96,10 @@ oc_log_component_name(oc_log_component_t component) #endif /* OC_CLOUD */ case OC_LOG_COMPONENT_COAP: return "coap"; +#ifdef OC_HAS_FEATURE_PLGD_DEVICE_PROVISIONING + case OC_LOG_COMPONENT_DEVICE_PROVISIONING: + return "dps"; +#endif } return ""; } diff --git a/api/plgd/device-provisioning-client/plgd_dps_log.c b/api/plgd/device-provisioning-client/plgd_dps_log.c index 65defa290a..2e18be0247 100644 --- a/api/plgd/device-provisioning-client/plgd_dps_log.c +++ b/api/plgd/device-provisioning-client/plgd_dps_log.c @@ -36,41 +36,8 @@ static struct } g_dps_logger = { .fn = NULL, .level = OC_LOG_LEVEL_INFO, - .components = PLGD_DPS_LOG_COMPONENT_DEFAULT, }; -const char * -dps_log_get_component_label(plgd_dps_log_component_t component) -{ - if (component == PLGD_DPS_LOG_COMPONENT_DEFAULT) { - return "default"; - } - return ""; -} - -static void dps_log_default_fn(oc_log_level_t level, - plgd_dps_log_component_t component, - const char *file, int line, - const char *func_name, const char *format, ...) - OC_PRINTF_FORMAT(6, 7); -static void -dps_log_default_fn(oc_log_level_t level, plgd_dps_log_component_t component, - const char *file, int line, const char *func_name, - const char *format, ...) -{ - char dps_log_fn_buf[64] = { 0 }; // NOLINT(readability-magic-numbers) - oc_clock_time_rfc3339(dps_log_fn_buf, sizeof(dps_log_fn_buf)); - - printf("[DPS:%s %s] %s: %s <%s:%d>: ", dps_log_get_component_label(component), - dps_log_fn_buf, oc_log_level_to_label(level), file, func_name, line); - va_list args; - va_start(args, format); - vprintf(format, args); - va_end(args); - printf("\n"); - fflush(stdout); -} - void plgd_dps_set_log_fn(plgd_dps_print_log_fn_t log_fn) { @@ -80,9 +47,6 @@ plgd_dps_set_log_fn(plgd_dps_print_log_fn_t log_fn) plgd_dps_print_log_fn_t plgd_dps_get_log_fn(void) { - if (g_dps_logger.fn == NULL) { - return &dps_log_default_fn; - } return g_dps_logger.fn; } @@ -99,15 +63,3 @@ plgd_dps_log_get_level(void) { return OC_ATOMIC_LOAD8(g_dps_logger.level); } - -void -plgd_dps_log_set_components(uint32_t components) -{ - OC_ATOMIC_STORE32(g_dps_logger.components, components); -} - -uint32_t -plgd_dps_log_get_components(void) -{ - return OC_ATOMIC_LOAD32(g_dps_logger.components); -} diff --git a/api/plgd/device-provisioning-client/plgd_dps_log_internal.h b/api/plgd/device-provisioning-client/plgd_dps_log_internal.h index 98511f93e3..2f85ca952e 100644 --- a/api/plgd/device-provisioning-client/plgd_dps_log_internal.h +++ b/api/plgd/device-provisioning-client/plgd_dps_log_internal.h @@ -16,32 +16,19 @@ * ****************************************************************************/ -// TODO: merge with oc_log? - #ifndef PLGD_DPS_LOG_INTERNAL_H #define PLGD_DPS_LOG_INTERNAL_H #include "plgd/plgd_dps.h" +#include "port/oc_log_internal.h" +#include "util/oc_compiler.h" #include "string.h" -#include "util/oc_compiler.h" #ifdef __cplusplus extern "C" { #endif -#ifndef __FILENAME__ -#ifdef WIN32 -// NOLINTNEXTLINE(bugprone-reserved-identifier) -#define __FILENAME__ \ - (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) -#else -// NOLINTNEXTLINE(bugprone-reserved-identifier) -#define __FILENAME__ \ - (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) -#endif -#endif /* !__FILENAME__ */ - #ifndef PLGD_DPS_LOG_MAXIMUM_LEVEL #define PLGD_DPS_LOG_MAXIMUM_LEVEL (OC_LOG_LEVEL_DISABLED_MACRO) #endif @@ -49,97 +36,68 @@ extern "C" { #define PLGD_DPS_LOG_LEVEL_IS_ENABLED(level) \ ((level) <= (PLGD_DPS_LOG_MAXIMUM_LEVEL)) -#ifdef __cplusplus -#define DPS_LOG_CAST -#else -#define DPS_LOG_CAST (plgd_dps_log_component_t) -#endif - -#define DPS_LOG(log_level, log_component, ...) \ +#define DPS_LOG(log_level, ...) \ do { \ - if (plgd_dps_log_get_level() >= (log_level) && \ - (plgd_dps_log_get_components() & log_component) != 0) { \ - plgd_dps_get_log_fn()((log_level), DPS_LOG_CAST(log_component), \ - __FILENAME__, __LINE__, __func__, __VA_ARGS__); \ + if (plgd_dps_log_get_level() >= (log_level)) { \ + plgd_dps_print_log_fn_t _dps_logger_fn = plgd_dps_get_log_fn(); \ + if (_dps_logger_fn != NULL) { \ + _dps_logger_fn((log_level), __FILENAME__, __LINE__, __func__, \ + __VA_ARGS__); \ + break; \ + } \ + OC_LOG_WITH_COMPONENT(log_level, OC_LOG_COMPONENT_DEVICE_PROVISIONING, \ + __VA_ARGS__); \ } \ } while (0) #define DPS_TRACE_IS_ENABLED \ PLGD_DPS_LOG_LEVEL_IS_ENABLED(OC_LOG_LEVEL_TRACE_MACRO) #if DPS_TRACE_IS_ENABLED -#define DPS_TRACE_COMPONENT(component, ...) \ - DPS_LOG(OC_LOG_LEVEL_TRACE, (component), __VA_ARGS__) -#define DPS_TRACE(...) \ - DPS_TRACE_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, __VA_ARGS__) +#define DPS_TRACE(...) DPS_LOG(OC_LOG_LEVEL_TRACE, __VA_ARGS__) #else /* !DPS_TRACE_IS_ENABLED */ #define DPS_TRACE(...) -#define DPS_TRACE_COMPONENT(component, ...) #endif /* DPS_TRACE_IS_ENABLED */ #define DPS_DBG_IS_ENABLED \ PLGD_DPS_LOG_LEVEL_IS_ENABLED(OC_LOG_LEVEL_DEBUG_MACRO) #if DPS_DBG_IS_ENABLED -#define DPS_DBG_COMPONENT(component, ...) \ - DPS_LOG(OC_LOG_LEVEL_DEBUG, (component), __VA_ARGS__) -#define DPS_DBG(...) \ - DPS_DBG_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, __VA_ARGS__) +#define DPS_DBG(...) DPS_LOG(OC_LOG_LEVEL_DEBUG, __VA_ARGS__) #else /* !DPS_DBG_IS_ENABLED */ -#define DPS_DBG_COMPONENT(component, ...) #define DPS_DBG(...) #endif /* DPS_DBG_IS_ENABLED */ #define DPS_INFO_IS_ENABLED \ PLGD_DPS_LOG_LEVEL_IS_ENABLED(OC_LOG_LEVEL_INFO_MACRO) #if DPS_INFO_IS_ENABLED -#define DPS_INFO_COMPONENT(component, ...) \ - DPS_LOG(OC_LOG_LEVEL_INFO, (component), __VA_ARGS__) -#define DPS_INFO(...) \ - DPS_INFO_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, __VA_ARGS__) +#define DPS_INFO(...) DPS_LOG(OC_LOG_LEVEL_INFO, __VA_ARGS__) #else /* !DPS_INFO_IS_ENABLED */ -#define DPS_INFO_COMPONENT(component, ...) #define DPS_INFO(...) #endif /* DPS_INFO_IS_ENABLED */ #define DPS_NOTE_IS_ENABLED \ PLGD_DPS_LOG_LEVEL_IS_ENABLED(OC_LOG_LEVEL_NOTICE_MACRO) #if DPS_NOTE_IS_ENABLED -#define DPS_NOTE_COMPONENT(component, ...) \ - DPS_LOG(OC_LOG_LEVEL_NOTICE, (component), __VA_ARGS__) -#define DPS_NOTE(...) \ - DPS_NOTE_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, __VA_ARGS__) +#define DPS_NOTE(...) DPS_LOG(OC_LOG_LEVEL_NOTICE, __VA_ARGS__) #else /* !DPS_NOTE_IS_ENABLED */ -#define DPS_NOTE_COMPONENT(component, ...) #define DPS_NOTE(...) #endif /* DPS_NOTE_IS_ENABLED */ #define DPS_WRN_IS_ENABLED \ PLGD_DPS_LOG_LEVEL_IS_ENABLED(OC_LOG_LEVEL_WARNING_MACRO) #if DPS_WRN_IS_ENABLED -#define DPS_WRN_COMPONENT(component, ...) \ - DPS_LOG(OC_LOG_LEVEL_WARNING, (component), __VA_ARGS__) -#define DPS_WRN(...) \ - DPS_WRN_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, __VA_ARGS__) +#define DPS_WRN(...) DPS_LOG(OC_LOG_LEVEL_WARNING, __VA_ARGS__) #else /* !DPS_WRN_IS_ENABLED */ -#define DPS_WRN_COMPONENT(component, ...) #define DPS_WRN(...) #endif /* DPS_WRN_IS_ENABLED */ #define DPS_ERR_IS_ENABLED \ PLGD_DPS_LOG_LEVEL_IS_ENABLED(OC_LOG_LEVEL_ERROR_MACRO) #if DPS_ERR_IS_ENABLED -#define DPS_ERR_COMPONENT(component, ...) \ - DPS_LOG(OC_LOG_LEVEL_ERROR, (component), __VA_ARGS__) -#define DPS_ERR(...) \ - DPS_ERR_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, __VA_ARGS__) +#define DPS_ERR(...) DPS_LOG(OC_LOG_LEVEL_ERROR, __VA_ARGS__) #else /* !DPS_ERR_IS_ENABLED */ -#define DPS_ERR_COMPONENT(component, ...) #define DPS_ERR(...) #endif /* DPS_ERR_IS_ENABLED */ -/** * @brief Get component label as a C-string. */ -const char *dps_log_get_component_label(plgd_dps_log_component_t component) - OC_RETURNS_NONNULL; - #ifdef __cplusplus } #endif diff --git a/api/plgd/unittest/plgd_dps_log.cpp b/api/plgd/unittest/plgd_dps_log.cpp index b3e6cafa6b..da812e5966 100644 --- a/api/plgd/unittest/plgd_dps_log.cpp +++ b/api/plgd/unittest/plgd_dps_log.cpp @@ -33,11 +33,7 @@ class TestDPSLog : public testing::Test { { plgd_dps_set_log_fn(nullptr); plgd_dps_log_set_level(OC_LOG_LEVEL_INFO); - plgd_dps_log_set_components(PLGD_DPS_LOG_COMPONENT_DEFAULT); } - - static constexpr int kLogComponent_1 = 1 << 16; - static constexpr int kLogComponent_2 = 1 << 17; }; TEST_F(TestDPSLog, LogToStdout) @@ -55,27 +51,15 @@ TEST_F(TestDPSLog, LogToStdout) DPS_TRACE("trace"); } -TEST_F(TestDPSLog, LogComponentLabel) -{ - EXPECT_STREQ( - dps_log_get_component_label(static_cast(-1)), ""); - - EXPECT_STREQ(dps_log_get_component_label(PLGD_DPS_LOG_COMPONENT_DEFAULT), - "default"); -} - -static void printLog(oc_log_level_t log_level, - plgd_dps_log_component_t component, const char *file, - int line, const char *func_name, const char *format, - va_list args) OC_PRINTF_FORMAT(6, 0); +static void printLog(oc_log_level_t log_level, const char *file, int line, + const char *func_name, const char *format, va_list args) + OC_PRINTF_FORMAT(5, 0); static void -printLog(oc_log_level_t log_level, plgd_dps_log_component_t component, - const char *file, int line, const char *func_name, const char *format, - va_list args) +printLog(oc_log_level_t log_level, const char *file, int line, + const char *func_name, const char *format, va_list args) { printf("[%s:%d %s]<%s:%s>: ", file, line, func_name, - dps_log_get_component_label(component), oc_log_level_to_label(log_level)); vprintf(format, args); printf("\n"); @@ -83,20 +67,19 @@ printLog(oc_log_level_t log_level, plgd_dps_log_component_t component, } static void expectUpToNotice(oc_log_level_t log_level, - plgd_dps_log_component_t component, + const char *file, int line, const char *func_name, - const char *format, ...) OC_PRINTF_FORMAT(6, 7); + const char *format, ...) OC_PRINTF_FORMAT(5, 6); static void -expectUpToNotice(oc_log_level_t log_level, plgd_dps_log_component_t component, - const char *file, int line, const char *func_name, - const char *format, ...) +expectUpToNotice(oc_log_level_t log_level, const char *file, int line, + const char *func_name, const char *format, ...) { EXPECT_TRUE(log_level == OC_LOG_LEVEL_ERROR || log_level == OC_LOG_LEVEL_WARNING || log_level == OC_LOG_LEVEL_NOTICE); va_list ap; va_start(ap, format); - printLog(log_level, component, file, line, func_name, format, ap); + printLog(log_level, file, line, func_name, format, ap); va_end(ap); } @@ -105,47 +88,16 @@ TEST_F(TestDPSLog, LogToFunction) plgd_dps_log_set_level(OC_LOG_LEVEL_NOTICE); plgd_dps_set_log_fn(expectUpToNotice); - DPS_LOG(OC_LOG_LEVEL_ERROR, PLGD_DPS_LOG_COMPONENT_DEFAULT, "error"); - DPS_LOG(OC_LOG_LEVEL_WARNING, PLGD_DPS_LOG_COMPONENT_DEFAULT, "warning"); - DPS_LOG(OC_LOG_LEVEL_NOTICE, PLGD_DPS_LOG_COMPONENT_DEFAULT, "notice"); - DPS_LOG(OC_LOG_LEVEL_INFO, PLGD_DPS_LOG_COMPONENT_DEFAULT, "info"); - DPS_LOG(OC_LOG_LEVEL_DEBUG, PLGD_DPS_LOG_COMPONENT_DEFAULT, "debug"); - DPS_LOG(OC_LOG_LEVEL_TRACE, PLGD_DPS_LOG_COMPONENT_DEFAULT, "trace"); -} - -static void expectComponents(oc_log_level_t log_level, - plgd_dps_log_component_t component, - const char *file, int line, const char *func_name, - const char *format, ...) OC_PRINTF_FORMAT(6, 7); - -static void -expectComponents(oc_log_level_t log_level, plgd_dps_log_component_t component, - const char *file, int line, const char *func_name, - const char *format, ...) -{ - EXPECT_TRUE(component == PLGD_DPS_LOG_COMPONENT_DEFAULT || - component == TestDPSLog::kLogComponent_1); - va_list ap; - va_start(ap, format); - printLog(log_level, component, file, line, func_name, format, ap); - va_end(ap); -} - -TEST_F(TestDPSLog, LogByComponent) -{ - plgd_dps_log_set_components(PLGD_DPS_LOG_COMPONENT_DEFAULT | kLogComponent_1); - plgd_dps_set_log_fn(expectComponents); - - DPS_ERR_COMPONENT(PLGD_DPS_LOG_COMPONENT_DEFAULT, "default error"); - DPS_ERR_COMPONENT(static_cast(kLogComponent_1), - "component_1 error"); - DPS_ERR_COMPONENT(static_cast(kLogComponent_2), - "component_2 error"); + DPS_LOG(OC_LOG_LEVEL_ERROR, "error"); + DPS_LOG(OC_LOG_LEVEL_WARNING, "warning"); + DPS_LOG(OC_LOG_LEVEL_NOTICE, "notice"); + DPS_LOG(OC_LOG_LEVEL_INFO, "info"); + DPS_LOG(OC_LOG_LEVEL_DEBUG, "debug"); + DPS_LOG(OC_LOG_LEVEL_TRACE, "trace"); } static void -expectNoLog(oc_log_level_t, plgd_dps_log_component_t, const char *, int, - const char *, const char *, ...) +expectNoLog(oc_log_level_t, const char *, int, const char *, const char *, ...) { FAIL() << "unexpected log"; } @@ -154,7 +106,6 @@ TEST_F(TestDPSLog, SkipLogByComponent) { plgd_dps_log_set_level(OC_LOG_LEVEL_TRACE); plgd_dps_set_log_fn(expectNoLog); - plgd_dps_log_set_components(0); DPS_ERR("error"); DPS_WRN("warning"); diff --git a/docker/apps/Dockerfile.dps-cloud-server-debug b/docker/apps/Dockerfile.dps-cloud-server-debug index 4f0f0ed42d..26aaef24b7 100644 --- a/docker/apps/Dockerfile.dps-cloud-server-debug +++ b/docker/apps/Dockerfile.dps-cloud-server-debug @@ -9,6 +9,7 @@ ARG BUILD_ARGS= RUN git clone https://github.com/wolfcw/libfaketime.git && \ cd /libfaketime/src && \ make install FAKETIME_COMPILE_CFLAGS="-DFAKE_SETTIME" +WORKDIR / RUN mkdir /device-provisioning-client COPY . /device-provisioning-client RUN adduser nonroot && \ diff --git a/include/oc_log.h b/include/oc_log.h index 7a38134a49..ee0d92a2bf 100644 --- a/include/oc_log.h +++ b/include/oc_log.h @@ -36,6 +36,7 @@ extern "C" { #include "oc_config.h" #include "oc_export.h" #include "util/oc_compiler.h" +#include "util/oc_features.h" #include #include @@ -166,6 +167,9 @@ typedef enum { OC_LOG_COMPONENT_CLOUD = 1 << 1, ///< cloud #endif OC_LOG_COMPONENT_COAP = 1 << 2, ///< coap +#ifdef OC_HAS_FEATURE_PLGD_DEVICE_PROVISIONING + OC_LOG_COMPONENT_DEVICE_PROVISIONING = 1 << 3, ///< device provisioning +#endif } oc_log_component_t; /** diff --git a/include/plgd/plgd_dps.h b/include/plgd/plgd_dps.h index bbbf2eb8c1..d53fcd9677 100644 --- a/include/plgd/plgd_dps.h +++ b/include/plgd/plgd_dps.h @@ -58,29 +58,19 @@ extern "C" { #endif -/** - * Log component determines the source of the message. - */ -typedef enum { - PLGD_DPS_LOG_COMPONENT_DEFAULT = 1 << 0, ///< default, non-specific component -} plgd_dps_log_component_t; - /** * @brief Custom logging function * * @param level log level of the message - * @param component log component of the message * @param file file of the log message call * @param line line of the log message call in \p file * @param func_name function name in which the log message call is invoked * @param format format of the log message */ -typedef void (*plgd_dps_print_log_fn_t)(oc_log_level_t level, - plgd_dps_log_component_t component, - const char *file, int line, - const char *func_name, +typedef void (*plgd_dps_print_log_fn_t)(oc_log_level_t level, const char *file, + int line, const char *func_name, const char *format, ...) - OC_PRINTF_FORMAT(6, 7) OC_NONNULL(); + OC_PRINTF_FORMAT(5, 6) OC_NONNULL(); /// @brief Set global logging function OC_API @@ -108,22 +98,6 @@ void plgd_dps_log_set_level(oc_log_level_t level); OC_API oc_log_level_t plgd_dps_log_get_level(void); -/** - * @brief Set enabled log components of the global logger. It is thread safe. - * - * @param components mask of enabled log components - */ -OC_API -void plgd_dps_log_set_components(uint32_t components); - -/** - * @brief Get enabled log components of the global logger. It is thread safe. - * - * @return uint32_t mask of enabled log components - */ -OC_API -uint32_t plgd_dps_log_get_components(void); - typedef struct plgd_dps_context_t plgd_dps_context_t; /**