From 2e6b5af5cb77a5809f3fb21f49ccd79781a04d92 Mon Sep 17 00:00:00 2001 From: Maksymilian Knust Date: Tue, 25 Jun 2024 07:47:08 +0200 Subject: [PATCH] Choose logging backend on a per-target basis (#32119) Executables and shared libraries now explicitly link with `platform/logging:default` or `platform/logging:stdio`, so that the `platform/logging:force_stdio` kludge is no longer needed. The `chip_monolithic_tests` gn arg has been moved to `build/chip/tests.gni`. --- build/chip/chip_test_suite.gni | 7 +- build/chip/tests.gni | 5 + config/common/cmake/chip_gn.cmake | 7 +- config/openiotsdk/CMakeLists.txt | 1 + config/openiotsdk/cmake/chip.cmake | 1 + examples/air-purifier-app/cc32xx/BUILD.gn | 1 + examples/all-clusters-app/asr/BUILD.gn | 1 + .../all-clusters-app/cc13x4_26x4/BUILD.gn | 1 + .../all-clusters-app/infineon/psoc6/BUILD.gn | 1 + examples/all-clusters-app/nxp/mw320/BUILD.gn | 5 +- .../all-clusters-app/nxp/rt/rw61x/BUILD.gn | 5 +- .../all-clusters-minimal-app/asr/BUILD.gn | 1 + .../infineon/psoc6/BUILD.gn | 1 + examples/bridge-app/asr/BUILD.gn | 1 + examples/chef/silabs/BUILD.gn | 1 + examples/chip-tool/BUILD.gn | 2 +- examples/common/tracing/BUILD.gn | 2 +- .../nxp/k32w/k32w0/BUILD.gn | 1 + .../nxp/k32w/k32w1/BUILD.gn | 1 + examples/dishwasher-app/asr/BUILD.gn | 1 + examples/fabric-admin/BUILD.gn | 2 +- .../laundry-washer-app/nxp/rt/rw61x/BUILD.gn | 5 +- examples/light-switch-app/asr/BUILD.gn | 1 + examples/light-switch-app/genio/BUILD.gn | 1 + .../infineon/cyw30739/BUILD.gn | 1 + examples/light-switch-app/qpg/BUILD.gn | 1 + examples/light-switch-app/silabs/BUILD.gn | 1 + examples/lighting-app/asr/BUILD.gn | 1 + .../lighting-app/bouffalolab/bl602/BUILD.gn | 1 + .../lighting-app/bouffalolab/bl702/BUILD.gn | 1 + .../lighting-app/bouffalolab/bl702l/BUILD.gn | 1 + examples/lighting-app/cc13x4_26x4/BUILD.gn | 1 + examples/lighting-app/genio/BUILD.gn | 1 + .../lighting-app/infineon/cyw30739/BUILD.gn | 1 + examples/lighting-app/infineon/psoc6/BUILD.gn | 1 + examples/lighting-app/nxp/k32w/k32w0/BUILD.gn | 1 + examples/lighting-app/nxp/k32w/k32w1/BUILD.gn | 1 + examples/lighting-app/qpg/BUILD.gn | 1 + examples/lighting-app/silabs/BUILD.gn | 1 + examples/lighting-app/stm32/BUILD.gn | 4 + examples/lit-icd-app/silabs/BUILD.gn | 1 + examples/lock-app/asr/BUILD.gn | 1 + examples/lock-app/cc13x4_26x4/BUILD.gn | 1 + examples/lock-app/cc32xx/BUILD.gn | 1 + examples/lock-app/genio/BUILD.gn | 1 + examples/lock-app/infineon/cyw30739/BUILD.gn | 1 + examples/lock-app/infineon/psoc6/BUILD.gn | 1 + examples/lock-app/qpg/BUILD.gn | 1 + examples/lock-app/silabs/BUILD.gn | 1 + examples/minimal-mdns/BUILD.gn | 3 + examples/ota-requestor-app/asr/BUILD.gn | 1 + examples/ota-requestor-app/genio/BUILD.gn | 1 + .../infineon/psoc6/BUILD.gn | 1 + examples/persistent-storage/linux/BUILD.gn | 5 +- examples/persistent-storage/qpg/BUILD.gn | 1 + examples/platform/linux/BUILD.gn | 2 +- .../openiotsdk/app/openiotsdk_platform.cpp | 8 +- examples/pump-app/cc13x4_26x4/BUILD.gn | 1 + examples/pump-app/silabs/BUILD.gn | 1 + .../pump-controller-app/cc13x4_26x4/BUILD.gn | 1 + examples/refrigerator-app/asr/BUILD.gn | 1 + examples/shell/cc13x4_26x4/BUILD.gn | 1 + examples/shell/genio/BUILD.gn | 1 + examples/shell/qpg/BUILD.gn | 1 + examples/shell/standalone/BUILD.gn | 1 + examples/smoke-co-alarm-app/silabs/BUILD.gn | 1 + .../temperature-measurement-app/asr/BUILD.gn | 1 + examples/thermostat/asr/BUILD.gn | 1 + examples/thermostat/genio/BUILD.gn | 1 + examples/thermostat/nxp/rt/rw61x/BUILD.gn | 5 +- examples/thermostat/qpg/BUILD.gn | 1 + examples/thermostat/silabs/BUILD.gn | 1 + examples/tv-app/android/BUILD.gn | 1 + examples/tv-casting-app/android/BUILD.gn | 1 + .../tv-casting-app/tv-casting-common/BUILD.gn | 1 + examples/virtual-device-app/android/BUILD.gn | 1 + examples/window-app/silabs/BUILD.gn | 1 + src/BUILD.gn | 5 - src/app/tests/integration/BUILD.gn | 2 + src/controller/java/BUILD.gn | 1 + src/controller/python/BUILD.gn | 1 + src/credentials/tests/BUILD.gn | 5 +- src/inet/tests/BUILD.gn | 1 + src/lib/BUILD.gn | 24 ++++- src/lib/core/tests/BUILD.gn | 5 +- src/lib/dnssd/minimal_mdns/tests/BUILD.gn | 5 +- src/messaging/tests/echo/BUILD.gn | 2 + src/messaging/tests/java/BUILD.gn | 5 +- src/platform/ASR/BUILD.gn | 9 +- src/platform/Ameba/BUILD.gn | 12 ++- src/platform/Beken/BUILD.gn | 9 +- src/platform/Darwin/BUILD.gn | 3 +- src/platform/ESP32/BUILD.gn | 9 +- src/platform/Infineon/CYW30739/BUILD.gn | 9 ++ src/platform/Infineon/PSOC6/BUILD.gn | 9 +- src/platform/Linux/BUILD.gn | 18 +++- src/platform/NuttX/BUILD.gn | 22 +++-- src/platform/Tizen/BUILD.gn | 16 +++- src/platform/Zephyr/BUILD.gn | 9 +- src/platform/bouffalolab/BL602/BUILD.gn | 1 - src/platform/bouffalolab/BL702/BUILD.gn | 1 - src/platform/bouffalolab/BL702L/BUILD.gn | 1 - src/platform/bouffalolab/common/BUILD.gn | 23 +++++ src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn | 10 +- src/platform/cc32xx/BUILD.gn | 8 +- src/platform/logging/BUILD.gn | 92 ++++++++++++++++--- src/platform/mbed/BUILD.gn | 12 ++- src/platform/mt793x/BUILD.gn | 9 +- src/platform/nrfconnect/BUILD.gn | 9 +- src/platform/nxp/BUILD.gn | 13 +++ src/platform/nxp/k32w/k32w0/BUILD.gn | 1 - src/platform/nxp/k32w/k32w1/BUILD.gn | 1 - src/platform/nxp/mw320/BUILD.gn | 9 +- src/platform/nxp/rt/rw61x/BUILD.gn | 1 - src/platform/nxp/zephyr/BUILD.gn | 1 - src/platform/openiotsdk/BUILD.gn | 11 ++- src/platform/openiotsdk/Logging.cpp | 7 -- src/platform/openiotsdk/Logging.h | 37 -------- src/platform/qpg/BUILD.gn | 9 +- src/platform/silabs/SiWx917/BUILD.gn | 9 +- src/platform/silabs/efr32/BUILD.gn | 16 +++- src/platform/telink/BUILD.gn | 8 ++ src/platform/webos/BUILD.gn | 9 +- src/pybindings/pycontroller/BUILD.gn | 1 + .../openiotsdk/unit-tests/CMakeLists.txt | 1 + 125 files changed, 479 insertions(+), 131 deletions(-) create mode 100644 src/platform/bouffalolab/common/BUILD.gn delete mode 100644 src/platform/openiotsdk/Logging.h diff --git a/build/chip/chip_test_suite.gni b/build/chip/chip_test_suite.gni index b4b3cc7d0df868..60f29346a48fa6 100644 --- a/build/chip/chip_test_suite.gni +++ b/build/chip/chip_test_suite.gni @@ -94,9 +94,12 @@ template("chip_test_suite") { deps = [ dir_pw_unit_test ] - if (current_os != "zephyr" && current_os != "mbed") { + if (current_os != "zephyr" && current_os != "mbed" && + chip_device_platform != "efr32") { # Depend on stdio logging, and have it take precedence over the default platform backend - public_deps += [ "${chip_root}/src/platform/logging:force_stdio" ] + public_deps += [ "${chip_root}/src/platform/logging:stdio" ] + } else { + public_deps += [ "${chip_root}/src/platform/logging:default" ] } } if (chip_link_tests) { diff --git a/build/chip/tests.gni b/build/chip/tests.gni index 8fb77932662634..0c2c742d646a15 100755 --- a/build/chip/tests.gni +++ b/build/chip/tests.gni @@ -18,6 +18,11 @@ import("//build_overrides/chip.gni") import("${chip_root}/build/chip/tools.gni") import("${chip_root}/src/platform/device.gni") +declare_args() { + # Build monolithic test library. + chip_monolithic_tests = false +} + declare_args() { # Enable building tests. chip_build_tests = current_os != "freertos" diff --git a/config/common/cmake/chip_gn.cmake b/config/common/cmake/chip_gn.cmake index 8370ec5902582e..c652bd4f486212 100644 --- a/config/common/cmake/chip_gn.cmake +++ b/config/common/cmake/chip_gn.cmake @@ -77,6 +77,7 @@ macro(matter_build target) LIB_PW_RPC LIB_MBEDTLS DEVICE_INFO_EXAMPLE_PROVIDER + FORCE_LOGGING_STDIO ) set(multiValueArgs GN_DEPENDENCIES) @@ -85,7 +86,11 @@ macro(matter_build target) set(MATTER_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib) # Prepare Matter libraries that the application should be linked with - set(MATTER_LIBRARIES -lCHIP) + if (FORCE_LOGGING_STDIO) + set(MATTER_LIBRARIES -lCHIPWithStdioLogging) + else() + set(MATTER_LIBRARIES -lCHIP) + endif() if (ARG_LIB_MBEDTLS) list(APPEND MATTER_LIBRARIES -lmbedtls) diff --git a/config/openiotsdk/CMakeLists.txt b/config/openiotsdk/CMakeLists.txt index ad659d091c4fd3..4dc0aebb6821be 100644 --- a/config/openiotsdk/CMakeLists.txt +++ b/config/openiotsdk/CMakeLists.txt @@ -79,6 +79,7 @@ matter_build(chip LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} LIB_TESTS ${CONFIG_CHIP_LIB_TESTS} GN_DEPENDENCIES ${CONFIG_GN_DEPENDENCIES} + FORCE_LOGGING_STDIO ${CONFIG_CHIP_FORCE_LOGGING_STDIO} ) target_link_libraries(chip INTERFACE diff --git a/config/openiotsdk/cmake/chip.cmake b/config/openiotsdk/cmake/chip.cmake index 1cb5a61cdeff02..a0eef560f926a9 100644 --- a/config/openiotsdk/cmake/chip.cmake +++ b/config/openiotsdk/cmake/chip.cmake @@ -27,6 +27,7 @@ set(CONFIG_CHIP_PROJECT_CONFIG_INCLUDE_DIRS "" CACHE STRING "") set(CONFIG_CHIP_LIB_TESTS NO CACHE BOOL "") set(CONFIG_CHIP_LIB_SHELL NO CACHE BOOL "") +set(CONFIG_CHIP_FORCE_LOGGING_STDIO NO CACHE BOOL "Enable stdio logging backend") set(CONFIG_CHIP_DETAIL_LOGGING YES CACHE BOOL "Enable logging at detail level") set(CONFIG_CHIP_PROGRESS_LOGGING YES CACHE BOOL "Enable logging at progress level") set(CONFIG_CHIP_AUTOMATION_LOGGING YES CACHE BOOL "Enable logging at automation level") diff --git a/examples/air-purifier-app/cc32xx/BUILD.gn b/examples/air-purifier-app/cc32xx/BUILD.gn index f79e76c82ce0d3..f9993edeba692b 100755 --- a/examples/air-purifier-app/cc32xx/BUILD.gn +++ b/examples/air-purifier-app/cc32xx/BUILD.gn @@ -100,6 +100,7 @@ ti_simplelink_executable("air-purifier_app") { "${chip_root}/examples/air-purifier-app/air-purifier-common", "${chip_root}/examples/platform/cc32xx:cc32xx-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/all-clusters-app/asr/BUILD.gn b/examples/all-clusters-app/asr/BUILD.gn index 6f70452fa71bbe..6b016c5d81119c 100755 --- a/examples/all-clusters-app/asr/BUILD.gn +++ b/examples/all-clusters-app/asr/BUILD.gn @@ -108,6 +108,7 @@ asr_executable("clusters_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn index 4a60c7992b197e..be89a8b3aecd80 100644 --- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn +++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn @@ -91,6 +91,7 @@ ti_simplelink_executable("all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common", "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/openthread:openthread", ] defines = [] diff --git a/examples/all-clusters-app/infineon/psoc6/BUILD.gn b/examples/all-clusters-app/infineon/psoc6/BUILD.gn index 9a0fbe3b3b37ac..64930593383bfe 100644 --- a/examples/all-clusters-app/infineon/psoc6/BUILD.gn +++ b/examples/all-clusters-app/infineon/psoc6/BUILD.gn @@ -138,6 +138,7 @@ psoc6_executable("clusters_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/all-clusters-app/nxp/mw320/BUILD.gn b/examples/all-clusters-app/nxp/mw320/BUILD.gn index 65d2df0401dd62..ebae8c34bccdee 100644 --- a/examples/all-clusters-app/nxp/mw320/BUILD.gn +++ b/examples/all-clusters-app/nxp/mw320/BUILD.gn @@ -63,7 +63,10 @@ mw320_executable("shell_mw320") { "${chip_root}/src/setup_payload", ] - deps = [ "${chip_root}/src/platform:syscalls_stub" ] + deps = [ + "${chip_root}/src/platform:syscalls_stub", + "${chip_root}/src/platform/logging:default", + ] include_dirs = [ "${chip_root}/src/platform/nxp/mw320", diff --git a/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn b/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn index 3e1ac42eacf61b..bfa4e89922f178 100644 --- a/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn +++ b/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn @@ -170,7 +170,10 @@ rt_executable("all_cluster_app") { "${common_example_dir}/matter_button/source/AppMatterButtonEmpty.cpp", ] - deps = [ "${chip_root}/examples/${app_common_folder}" ] + deps = [ + "${chip_root}/examples/${app_common_folder}", + "${chip_root}/src/platform/logging:default", + ] sources += [ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", diff --git a/examples/all-clusters-minimal-app/asr/BUILD.gn b/examples/all-clusters-minimal-app/asr/BUILD.gn index 33401d925e7b54..da47c98a26be09 100755 --- a/examples/all-clusters-minimal-app/asr/BUILD.gn +++ b/examples/all-clusters-minimal-app/asr/BUILD.gn @@ -94,6 +94,7 @@ asr_executable("clusters_minimal_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/BUILD.gn b/examples/all-clusters-minimal-app/infineon/psoc6/BUILD.gn index 721b1492d4c1f5..c70c282db2ac17 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/BUILD.gn +++ b/examples/all-clusters-minimal-app/infineon/psoc6/BUILD.gn @@ -126,6 +126,7 @@ psoc6_executable("clusters_minimal_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/bridge-app/asr/BUILD.gn b/examples/bridge-app/asr/BUILD.gn index 93c512203129b2..0fb9be4dcd99c4 100755 --- a/examples/bridge-app/asr/BUILD.gn +++ b/examples/bridge-app/asr/BUILD.gn @@ -95,6 +95,7 @@ asr_executable("bridge_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/chef/silabs/BUILD.gn b/examples/chef/silabs/BUILD.gn index 528fe2f2cfc50a..f7192457588b26 100644 --- a/examples/chef/silabs/BUILD.gn +++ b/examples/chef/silabs/BUILD.gn @@ -94,6 +94,7 @@ silabs_executable("chef_app") { deps = [ ":chef-common", ":sdk", + "${chip_root}/src/platform/logging:default", "${examples_plat_dir}:efr32-common", ] diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 10d03c02ee295d..b5917f3bfaca62 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -132,7 +132,7 @@ executable("chip-tool") { deps = [ ":chip-tool-utils", - "${chip_root}/src/platform/logging:force_stdio", + "${chip_root}/src/platform/logging:stdio", ] output_dir = root_out_dir diff --git a/examples/common/tracing/BUILD.gn b/examples/common/tracing/BUILD.gn index cf6fdc2da525b4..9a1193060058db 100644 --- a/examples/common/tracing/BUILD.gn +++ b/examples/common/tracing/BUILD.gn @@ -120,7 +120,7 @@ executable("chip-trace-decoder") { output_dir = root_out_dir - deps = [ "${chip_root}/src/platform/logging:force_stdio" ] + deps = [ "${chip_root}/src/platform/logging:stdio" ] public_deps = [ "${chip_root}/src/lib", diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn b/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn index 4b9f501690d732..b69897172a1e8d 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn @@ -114,6 +114,7 @@ k32w0_executable("contact_sensor_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/platform:syscalls_stub", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/mbedtls:mbedtls", "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils", ] diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn index 400b4003c3d1b9..f4ccc1ec4d8c39 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn +++ b/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn @@ -110,6 +110,7 @@ k32w1_executable("contact_sensor_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/platform:syscalls_stub", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/mbedtls:mbedtls", "${k32w1_platform_dir}/app/support:freertos_mbedtls_utils", ] diff --git a/examples/dishwasher-app/asr/BUILD.gn b/examples/dishwasher-app/asr/BUILD.gn index eaf4c855eefc17..172bf708331afe 100755 --- a/examples/dishwasher-app/asr/BUILD.gn +++ b/examples/dishwasher-app/asr/BUILD.gn @@ -92,6 +92,7 @@ asr_executable("dishwasher_app") { "${chip_root}/examples/dishwasher-app/dishwasher-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/fabric-admin/BUILD.gn b/examples/fabric-admin/BUILD.gn index 4db5cb9040ad4b..9ab444d5f8dc9c 100644 --- a/examples/fabric-admin/BUILD.gn +++ b/examples/fabric-admin/BUILD.gn @@ -157,7 +157,7 @@ executable("fabric-admin") { deps = [ ":fabric-admin-utils", - "${chip_root}/src/platform/logging:force_stdio", + "${chip_root}/src/platform/logging:stdio", ] output_dir = root_out_dir diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn b/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn index a9840f74f20d0f..d2dba4e2403655 100644 --- a/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn +++ b/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn @@ -171,7 +171,10 @@ rt_executable("laundry-washer") { "${common_example_dir}/matter_button/source/AppMatterButtonEmpty.cpp", ] - deps = [ "${chip_root}/examples/${app_common_folder}" ] + deps = [ + "${chip_root}/examples/${app_common_folder}", + "${chip_root}/src/platform/logging:default", + ] sources += [ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", diff --git a/examples/light-switch-app/asr/BUILD.gn b/examples/light-switch-app/asr/BUILD.gn index 7eac5d28b65858..1e84ea55510992 100755 --- a/examples/light-switch-app/asr/BUILD.gn +++ b/examples/light-switch-app/asr/BUILD.gn @@ -75,6 +75,7 @@ asr_executable("light_switch_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/light-switch-app/genio/BUILD.gn b/examples/light-switch-app/genio/BUILD.gn index ba3f349a011df5..f7e04013790734 100644 --- a/examples/light-switch-app/genio/BUILD.gn +++ b/examples/light-switch-app/genio/BUILD.gn @@ -83,6 +83,7 @@ mt793x_executable("light_switch_app") { "${chip_root}/examples/light-switch-app/light-switch-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${mt793x_examples_plat_dir}:genio-matter-shell", ] diff --git a/examples/light-switch-app/infineon/cyw30739/BUILD.gn b/examples/light-switch-app/infineon/cyw30739/BUILD.gn index a096888849634b..bc13b83b582432 100644 --- a/examples/light-switch-app/infineon/cyw30739/BUILD.gn +++ b/examples/light-switch-app/infineon/cyw30739/BUILD.gn @@ -45,6 +45,7 @@ template("matter_wpan_app") { deps = [ "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/light-switch-app/qpg/BUILD.gn b/examples/light-switch-app/qpg/BUILD.gn index 84ec9dd64173ac..4e8851b3d79a7b 100644 --- a/examples/light-switch-app/qpg/BUILD.gn +++ b/examples/light-switch-app/qpg/BUILD.gn @@ -65,6 +65,7 @@ qpg_executable("light_switch_app") { "${chip_root}/examples/light-switch-app/qpg/zap/", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", diff --git a/examples/light-switch-app/silabs/BUILD.gn b/examples/light-switch-app/silabs/BUILD.gn index f302a1593facce..2602842edf4d83 100644 --- a/examples/light-switch-app/silabs/BUILD.gn +++ b/examples/light-switch-app/silabs/BUILD.gn @@ -166,6 +166,7 @@ silabs_executable("light_switch_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", + "${chip_root}/src/platform/logging:default", ] if (wifi_soc) { diff --git a/examples/lighting-app/asr/BUILD.gn b/examples/lighting-app/asr/BUILD.gn index 576a50b92aa7f8..ecacd5d44465ba 100755 --- a/examples/lighting-app/asr/BUILD.gn +++ b/examples/lighting-app/asr/BUILD.gn @@ -92,6 +92,7 @@ asr_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index 7a4d4545e5ef28..f03a18c004a131 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -146,6 +146,7 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index 05526ff9563e58..ac3a5e5f7e66af 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -173,6 +173,7 @@ bouffalolab_executable("lighting_app") { ":sdk", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn index ea06cfa41ac001..f7ca4144bb8a04 100644 --- a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn @@ -148,6 +148,7 @@ bouffalolab_executable("lighting_app") { ":sdk", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lighting-app/cc13x4_26x4/BUILD.gn b/examples/lighting-app/cc13x4_26x4/BUILD.gn index 55d78f140fb2d4..d3c0df34e6ce3d 100644 --- a/examples/lighting-app/cc13x4_26x4/BUILD.gn +++ b/examples/lighting-app/cc13x4_26x4/BUILD.gn @@ -77,6 +77,7 @@ ti_simplelink_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/openthread:openthread", ] defines = [] diff --git a/examples/lighting-app/genio/BUILD.gn b/examples/lighting-app/genio/BUILD.gn index 6d7e34c9db4d8f..3de6ee025e4a9a 100644 --- a/examples/lighting-app/genio/BUILD.gn +++ b/examples/lighting-app/genio/BUILD.gn @@ -84,6 +84,7 @@ mt793x_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${mt793x_examples_plat_dir}:genio-matter-shell", ] diff --git a/examples/lighting-app/infineon/cyw30739/BUILD.gn b/examples/lighting-app/infineon/cyw30739/BUILD.gn index 8fce49a0792afc..9fcd2bd8c1b793 100644 --- a/examples/lighting-app/infineon/cyw30739/BUILD.gn +++ b/examples/lighting-app/infineon/cyw30739/BUILD.gn @@ -43,6 +43,7 @@ template("matter_wpan_app") { deps = [ "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/lighting-app/infineon/psoc6/BUILD.gn b/examples/lighting-app/infineon/psoc6/BUILD.gn index ee8baf91f9ea6b..3bd75cc14d9e2c 100644 --- a/examples/lighting-app/infineon/psoc6/BUILD.gn +++ b/examples/lighting-app/infineon/psoc6/BUILD.gn @@ -122,6 +122,7 @@ psoc6_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn index 322c728a063ba7..82afd7ad22864d 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn @@ -115,6 +115,7 @@ k32w0_executable("light_app") { "${chip_root}/src/app:test-event-trigger", "${chip_root}/src/lib", "${chip_root}/src/platform:syscalls_stub", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/mbedtls:mbedtls", "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils", ] diff --git a/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn index 7785720c28c3ec..dd40445e0e7b79 100644 --- a/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn +++ b/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn @@ -141,6 +141,7 @@ k32w1_executable("light_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/platform:syscalls_stub", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/mbedtls:mbedtls", "${k32w1_platform_dir}/app/support:freertos_mbedtls_utils", ] diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 2677357a2f21e1..886c8aa313d097 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -67,6 +67,7 @@ qpg_executable("lighting_app") { "${chip_root}/examples/lighting-app/qpg/zap/", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", diff --git a/examples/lighting-app/silabs/BUILD.gn b/examples/lighting-app/silabs/BUILD.gn index 4ca705caac2cef..55d7d4100946f2 100644 --- a/examples/lighting-app/silabs/BUILD.gn +++ b/examples/lighting-app/silabs/BUILD.gn @@ -143,6 +143,7 @@ silabs_executable("lighting_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/lighting-app/stm32/BUILD.gn b/examples/lighting-app/stm32/BUILD.gn index 3ac2fd365f11fa..6e338610d94821 100644 --- a/examples/lighting-app/stm32/BUILD.gn +++ b/examples/lighting-app/stm32/BUILD.gn @@ -84,6 +84,8 @@ stm32_sdk("sdk") { } stm32_executable("lighting_app") { + deps = [] + if (stm32_board == "STM32WB5MM-DK") { output_name = "chip-stm32-lighting-example.elf" include_dirs = [ @@ -118,6 +120,8 @@ stm32_executable("lighting_app") { ] } + deps += [ "${chip_root}/src/platform/logging:default" ] + # Add the startup file to the target sources += [ "${examples_plat_dir}/startup_files/startup_${stm32_mcu}.s" ] diff --git a/examples/lit-icd-app/silabs/BUILD.gn b/examples/lit-icd-app/silabs/BUILD.gn index d0956cc9a7a2e3..eb7fa7a09a6d95 100644 --- a/examples/lit-icd-app/silabs/BUILD.gn +++ b/examples/lit-icd-app/silabs/BUILD.gn @@ -125,6 +125,7 @@ silabs_executable("lit_icd_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/lock-app/asr/BUILD.gn b/examples/lock-app/asr/BUILD.gn index 07d6adf3689c7f..e18ff4c2b1a8e1 100755 --- a/examples/lock-app/asr/BUILD.gn +++ b/examples/lock-app/asr/BUILD.gn @@ -76,6 +76,7 @@ asr_executable("lock_app") { "${chip_root}/examples/lock-app/lock-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lock-app/cc13x4_26x4/BUILD.gn b/examples/lock-app/cc13x4_26x4/BUILD.gn index 12baedb9ead35e..638e26cafb683d 100644 --- a/examples/lock-app/cc13x4_26x4/BUILD.gn +++ b/examples/lock-app/cc13x4_26x4/BUILD.gn @@ -85,6 +85,7 @@ ti_simplelink_executable("lock_app") { "${chip_root}/examples/lock-app/lock-common", "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/openthread:openthread", ] defines = [] diff --git a/examples/lock-app/cc32xx/BUILD.gn b/examples/lock-app/cc32xx/BUILD.gn index e1eb3041555d70..218263e4634f75 100755 --- a/examples/lock-app/cc32xx/BUILD.gn +++ b/examples/lock-app/cc32xx/BUILD.gn @@ -97,6 +97,7 @@ ti_simplelink_executable("lock_app") { "${chip_root}/examples/lock-app/lock-common", "${chip_root}/examples/platform/cc32xx:cc32xx-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lock-app/genio/BUILD.gn b/examples/lock-app/genio/BUILD.gn index 8b37e0202d10a8..94dbaa199c7b75 100644 --- a/examples/lock-app/genio/BUILD.gn +++ b/examples/lock-app/genio/BUILD.gn @@ -83,6 +83,7 @@ mt793x_executable("lock_app") { "${chip_root}/examples/lock-app/lock-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${mt793x_examples_plat_dir}:genio-matter-shell", ] diff --git a/examples/lock-app/infineon/cyw30739/BUILD.gn b/examples/lock-app/infineon/cyw30739/BUILD.gn index 7ce4c26c03f4cc..786394bff9b75d 100644 --- a/examples/lock-app/infineon/cyw30739/BUILD.gn +++ b/examples/lock-app/infineon/cyw30739/BUILD.gn @@ -43,6 +43,7 @@ template("matter_wpan_app") { deps = [ "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/lock-app/infineon/psoc6/BUILD.gn b/examples/lock-app/infineon/psoc6/BUILD.gn index 6714fc03ef9af8..37ee666f5190f5 100644 --- a/examples/lock-app/infineon/psoc6/BUILD.gn +++ b/examples/lock-app/infineon/psoc6/BUILD.gn @@ -110,6 +110,7 @@ psoc6_executable("lock_app") { "${chip_root}/examples/lock-app/lock-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index 3db4d0cd1ee86d..07019cc249f729 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -65,6 +65,7 @@ qpg_executable("lock_app") { "${chip_root}/examples/lock-app/qpg/zap/", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", diff --git a/examples/lock-app/silabs/BUILD.gn b/examples/lock-app/silabs/BUILD.gn index fe2abc95512c20..a20a4ad66fedc7 100644 --- a/examples/lock-app/silabs/BUILD.gn +++ b/examples/lock-app/silabs/BUILD.gn @@ -128,6 +128,7 @@ silabs_executable("lock_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/minimal-mdns/BUILD.gn b/examples/minimal-mdns/BUILD.gn index 3ad5761229b85e..f922289b9439c8 100644 --- a/examples/minimal-mdns/BUILD.gn +++ b/examples/minimal-mdns/BUILD.gn @@ -54,6 +54,7 @@ executable("minimal-mdns-client") { "${chip_root}/examples/common/tracing:commandline", "${chip_root}/src/lib", "${chip_root}/src/lib/dnssd/minimal_mdns", + "${chip_root}/src/platform/logging:default", ] cflags = [ "-Wconversion" ] @@ -70,6 +71,7 @@ executable("minimal-mdns-server") { "${chip_root}/src/lib", "${chip_root}/src/lib/dnssd/minimal_mdns", "${chip_root}/src/lib/dnssd/minimal_mdns/responders", + "${chip_root}/src/platform/logging:default", ] cflags = [ "-Wconversion" ] @@ -85,6 +87,7 @@ executable("mdns-advertiser") { "${chip_root}/examples/common/tracing:commandline", "${chip_root}/src/lib", "${chip_root}/src/lib/dnssd", + "${chip_root}/src/platform/logging:default", ] cflags = [ "-Wconversion" ] diff --git a/examples/ota-requestor-app/asr/BUILD.gn b/examples/ota-requestor-app/asr/BUILD.gn index 42bddbc7f07d9b..6f29e1723d7164 100755 --- a/examples/ota-requestor-app/asr/BUILD.gn +++ b/examples/ota-requestor-app/asr/BUILD.gn @@ -90,6 +90,7 @@ asr_executable("ota_requestor_app") { "${chip_root}/examples/ota-requestor-app/ota-requestor-common", "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/ota-requestor-app/genio/BUILD.gn b/examples/ota-requestor-app/genio/BUILD.gn index 450c45b12f6a80..609ca57a5f1ac2 100644 --- a/examples/ota-requestor-app/genio/BUILD.gn +++ b/examples/ota-requestor-app/genio/BUILD.gn @@ -76,6 +76,7 @@ mt793x_executable("ota_reuqestor_app") { "${chip_root}/examples/common/QRCode", "${chip_root}/examples/ota-requestor-app/ota-requestor-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${mt793x_examples_plat_dir}:genio-matter-shell", ] diff --git a/examples/persistent-storage/infineon/psoc6/BUILD.gn b/examples/persistent-storage/infineon/psoc6/BUILD.gn index d359f833815136..6c1b536280e60b 100644 --- a/examples/persistent-storage/infineon/psoc6/BUILD.gn +++ b/examples/persistent-storage/infineon/psoc6/BUILD.gn @@ -56,6 +56,7 @@ psoc6_executable("persistent_storage_app") { public_deps = [ ":persistent_storage_app_sdk_sources", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/persistent-storage/linux/BUILD.gn b/examples/persistent-storage/linux/BUILD.gn index e01cc757180484..1d13bb34709c1b 100644 --- a/examples/persistent-storage/linux/BUILD.gn +++ b/examples/persistent-storage/linux/BUILD.gn @@ -20,7 +20,10 @@ executable("persistent_storage") { "main.cpp", ] - deps = [ "${chip_root}/src/lib" ] + deps = [ + "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", + ] cflags = [ "-Wconversion" ] diff --git a/examples/persistent-storage/qpg/BUILD.gn b/examples/persistent-storage/qpg/BUILD.gn index 546ec94cf2c9b9..a5e636c89c78b4 100644 --- a/examples/persistent-storage/qpg/BUILD.gn +++ b/examples/persistent-storage/qpg/BUILD.gn @@ -44,6 +44,7 @@ qpg_executable("persistent_storage_app") { ":sdk", "${chip_root}/src/app", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", ] include_dirs += [ diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 8cf00c5be5e62c..4641eae6446e04 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -79,7 +79,7 @@ source_set("app-main") { ":energy-reporting-test-event-trigger", ":smco-test-event-trigger", "${chip_root}/src/lib", - "${chip_root}/src/platform/logging:force_stdio", + "${chip_root}/src/platform/logging:stdio", ] deps = [ ":ota-test-event-trigger", diff --git a/examples/platform/openiotsdk/app/openiotsdk_platform.cpp b/examples/platform/openiotsdk/app/openiotsdk_platform.cpp index 761b5488eeab9b..56bb7c24902bbc 100644 --- a/examples/platform/openiotsdk/app/openiotsdk_platform.cpp +++ b/examples/platform/openiotsdk/app/openiotsdk_platform.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -59,7 +59,7 @@ using namespace ::chip; using namespace ::chip::Platform; using namespace ::chip::DeviceLayer; -using namespace ::chip::Logging::Platform; +using namespace ::chip::Logging; constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; @@ -172,7 +172,9 @@ int openiotsdk_platform_init(void) { int ret; - ois_logging_init(); +#if defined(NDEBUG) && CHIP_CONFIG_TEST == 0 + SetLogFilter(LogCategory::kLogCategory_Progress); +#endif ret = mbedtls_platform_setup(NULL); if (ret) diff --git a/examples/pump-app/cc13x4_26x4/BUILD.gn b/examples/pump-app/cc13x4_26x4/BUILD.gn index 8770c4e8f34a59..1429379e2bedb3 100644 --- a/examples/pump-app/cc13x4_26x4/BUILD.gn +++ b/examples/pump-app/cc13x4_26x4/BUILD.gn @@ -77,6 +77,7 @@ ti_simplelink_executable("pump_app") { "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/examples/pump-app/pump-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/openthread:openthread", ] defines = [] diff --git a/examples/pump-app/silabs/BUILD.gn b/examples/pump-app/silabs/BUILD.gn index 9b577950023bc0..8321ba6c80adc9 100644 --- a/examples/pump-app/silabs/BUILD.gn +++ b/examples/pump-app/silabs/BUILD.gn @@ -141,6 +141,7 @@ silabs_executable("pump_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/pump-controller-app/cc13x4_26x4/BUILD.gn b/examples/pump-controller-app/cc13x4_26x4/BUILD.gn index 2d823d8bb129bc..7227fe31adafcc 100644 --- a/examples/pump-controller-app/cc13x4_26x4/BUILD.gn +++ b/examples/pump-controller-app/cc13x4_26x4/BUILD.gn @@ -76,6 +76,7 @@ ti_simplelink_executable("pump_controller_app") { "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/examples/pump-controller-app/pump-controller-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/openthread:openthread", ] defines = [] diff --git a/examples/refrigerator-app/asr/BUILD.gn b/examples/refrigerator-app/asr/BUILD.gn index ec5abde393fcf6..c2262d8c9044f7 100755 --- a/examples/refrigerator-app/asr/BUILD.gn +++ b/examples/refrigerator-app/asr/BUILD.gn @@ -91,6 +91,7 @@ asr_executable("refrigerator_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/examples/refrigerator-app/refrigerator-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/shell/cc13x4_26x4/BUILD.gn b/examples/shell/cc13x4_26x4/BUILD.gn index d16b5b43984ab7..4309c55c8b7335 100644 --- a/examples/shell/cc13x4_26x4/BUILD.gn +++ b/examples/shell/cc13x4_26x4/BUILD.gn @@ -75,6 +75,7 @@ ti_simplelink_executable("shell_app") { "${chip_root}/examples/shell/shell_common:shell_common", "${chip_root}/src/lib", "${chip_root}/src/lib/shell:shell", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread:openthread", ] diff --git a/examples/shell/genio/BUILD.gn b/examples/shell/genio/BUILD.gn index 08a6eb9c2186f0..80d8babb2dec17 100644 --- a/examples/shell/genio/BUILD.gn +++ b/examples/shell/genio/BUILD.gn @@ -53,6 +53,7 @@ mt793x_executable("shell_app") { "${chip_root}/examples/shell/shell_common:shell_common", "${chip_root}/src/lib", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${mt793x_ex_plat_dir}:genio-matter-shell", ] diff --git a/examples/shell/qpg/BUILD.gn b/examples/shell/qpg/BUILD.gn index ec477e194bbf12..a882810e7077b8 100644 --- a/examples/shell/qpg/BUILD.gn +++ b/examples/shell/qpg/BUILD.gn @@ -49,6 +49,7 @@ qpg_executable("shell_app") { ":sdk", "${chip_root}/examples/shell/shell_common:shell_common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", diff --git a/examples/shell/standalone/BUILD.gn b/examples/shell/standalone/BUILD.gn index cfa97b10f7c63d..13b4c43f4e2e99 100644 --- a/examples/shell/standalone/BUILD.gn +++ b/examples/shell/standalone/BUILD.gn @@ -28,6 +28,7 @@ executable("chip-shell") { deps = [ "${chip_root}/src/lib/shell", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${project_dir}/shell_common:shell_common", ] diff --git a/examples/smoke-co-alarm-app/silabs/BUILD.gn b/examples/smoke-co-alarm-app/silabs/BUILD.gn index 73b015ea232822..c6fe0967a9775b 100644 --- a/examples/smoke-co-alarm-app/silabs/BUILD.gn +++ b/examples/smoke-co-alarm-app/silabs/BUILD.gn @@ -144,6 +144,7 @@ silabs_executable("smoke_co_alarm_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/temperature-measurement-app/asr/BUILD.gn b/examples/temperature-measurement-app/asr/BUILD.gn index dd6ea2665eb8c3..27c82d7202ef03 100755 --- a/examples/temperature-measurement-app/asr/BUILD.gn +++ b/examples/temperature-measurement-app/asr/BUILD.gn @@ -77,6 +77,7 @@ asr_executable("temperature_measurement_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/examples/temperature-measurement-app/temperature-measurement-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/thermostat/asr/BUILD.gn b/examples/thermostat/asr/BUILD.gn index ad1a4dbcab72be..0846cf8aae9d30 100755 --- a/examples/thermostat/asr/BUILD.gn +++ b/examples/thermostat/asr/BUILD.gn @@ -78,6 +78,7 @@ asr_executable("thermostat") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/examples/thermostat/thermostat-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", ] diff --git a/examples/thermostat/genio/BUILD.gn b/examples/thermostat/genio/BUILD.gn index d0fb18cbe9aaef..2be1dd193aaacb 100644 --- a/examples/thermostat/genio/BUILD.gn +++ b/examples/thermostat/genio/BUILD.gn @@ -82,6 +82,7 @@ mt793x_executable("thermostat") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/examples/thermostat/thermostat-common", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${mt793x_examples_plat_dir}:genio-matter-shell", ] diff --git a/examples/thermostat/nxp/rt/rw61x/BUILD.gn b/examples/thermostat/nxp/rt/rw61x/BUILD.gn index dbd1bda583dea6..3b7b8d181e3939 100644 --- a/examples/thermostat/nxp/rt/rw61x/BUILD.gn +++ b/examples/thermostat/nxp/rt/rw61x/BUILD.gn @@ -167,7 +167,10 @@ rt_executable("thermostat") { "${common_example_dir}/matter_button/source/AppMatterButtonEmpty.cpp", ] - deps = [ "${chip_root}/examples/${app_common_folder}" ] + deps = [ + "${chip_root}/examples/${app_common_folder}", + "${chip_root}/src/platform/logging:default", + ] if (chip_enable_matter_cli) { defines += [ "ENABLE_CHIP_SHELL" ] diff --git a/examples/thermostat/qpg/BUILD.gn b/examples/thermostat/qpg/BUILD.gn index 11a0317a6abc0f..4841fdd8edf468 100644 --- a/examples/thermostat/qpg/BUILD.gn +++ b/examples/thermostat/qpg/BUILD.gn @@ -64,6 +64,7 @@ qpg_executable("thermostat") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/examples/thermostat/qpg/zap/", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", diff --git a/examples/thermostat/silabs/BUILD.gn b/examples/thermostat/silabs/BUILD.gn index bb094b894f8db3..75b2f75c15c863 100644 --- a/examples/thermostat/silabs/BUILD.gn +++ b/examples/thermostat/silabs/BUILD.gn @@ -158,6 +158,7 @@ silabs_executable("thermostat_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/examples/tv-app/android/BUILD.gn b/examples/tv-app/android/BUILD.gn index 963733634172be..38c75d9273c243 100644 --- a/examples/tv-app/android/BUILD.gn +++ b/examples/tv-app/android/BUILD.gn @@ -88,6 +88,7 @@ shared_library("jni") { "${chip_root}/src/app/server/java:jni", "${chip_root}/src/lib", "${chip_root}/src/lib/support/jsontlv", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/inipp", ] diff --git a/examples/tv-casting-app/android/BUILD.gn b/examples/tv-casting-app/android/BUILD.gn index 48d68100930a91..c4c50bb85d8c9a 100644 --- a/examples/tv-casting-app/android/BUILD.gn +++ b/examples/tv-casting-app/android/BUILD.gn @@ -57,6 +57,7 @@ shared_library("jni") { "${chip_root}/src/app/server/java:jni", "${chip_root}/src/controller/java:android_chip_im_jni", "${chip_root}/src/lib", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/inipp", ] diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 3899773592e5dd..ee422e1b063db9 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -153,6 +153,7 @@ static_library("tvCastingCommon") { public_deps = [ "${chip_root}/examples/tv-casting-app/tv-casting-common", "${chip_root}/src/credentials:default_attestation_verifier", + "${chip_root}/src/platform/logging:default", ] cflags = [ "-Wconversion" ] diff --git a/examples/virtual-device-app/android/BUILD.gn b/examples/virtual-device-app/android/BUILD.gn index 8ff5677a3e3aad..7f071107544719 100644 --- a/examples/virtual-device-app/android/BUILD.gn +++ b/examples/virtual-device-app/android/BUILD.gn @@ -46,6 +46,7 @@ shared_library("jni") { "${chip_root}/src/app/server/java:jni", "${chip_root}/src/lib", "${chip_root}/src/lib/support/jsontlv", + "${chip_root}/src/platform/logging:default", "${chip_root}/third_party/inipp", ] diff --git a/examples/window-app/silabs/BUILD.gn b/examples/window-app/silabs/BUILD.gn index cc6f916712d233..c45dbda632a5f9 100644 --- a/examples/window-app/silabs/BUILD.gn +++ b/examples/window-app/silabs/BUILD.gn @@ -126,6 +126,7 @@ silabs_executable("window_app") { deps = [ ":sdk", + "${chip_root}/src/platform/logging:default", app_data_model, ] diff --git a/src/BUILD.gn b/src/BUILD.gn index 851c982ab6f15b..27f449dcf8e543 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -22,11 +22,6 @@ import("${chip_root}/src/ble/ble.gni") import("${chip_root}/src/platform/device.gni") import("${chip_root}/src/tracing/tracing_args.gni") -declare_args() { - # Build monolithic test library. - chip_monolithic_tests = false -} - # chip_root relative to root_build_dir for macro-prefix-map. # "/." avoids trailing "/" in result when chip_root is "//" build_relative_chip_root = rebase_path("${chip_root}/.", root_build_dir) diff --git a/src/app/tests/integration/BUILD.gn b/src/app/tests/integration/BUILD.gn index 49aea9034e9766..6acd4ccdd8d6af 100644 --- a/src/app/tests/integration/BUILD.gn +++ b/src/app/tests/integration/BUILD.gn @@ -48,6 +48,7 @@ executable("chip-im-initiator") { "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/protocols", "${chip_root}/src/system", ] @@ -71,6 +72,7 @@ executable("chip-im-responder") { "${chip_root}/src/lib/support", "${chip_root}/src/messaging", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/protocols", "${chip_root}/src/system", ] diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index eda7ea7497cef5..0f5d7e788a33c7 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -154,6 +154,7 @@ shared_library("jni") { "${chip_root}/src/lib", "${chip_root}/src/lib/support/jsontlv", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", ] if (chip_build_controller_dynamic_server) { diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn index 747aa522504ca6..57822f9ff34602 100644 --- a/src/controller/python/BUILD.gn +++ b/src/controller/python/BUILD.gn @@ -126,6 +126,7 @@ shared_library("ChipDeviceCtrl") { "${chip_root}/src/lib/dnssd", "${chip_root}/src/lib/support", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/src/transport", ] diff --git a/src/credentials/tests/BUILD.gn b/src/credentials/tests/BUILD.gn index 766557d8126124..2ec6db203bcaa0 100644 --- a/src/credentials/tests/BUILD.gn +++ b/src/credentials/tests/BUILD.gn @@ -76,6 +76,9 @@ chip_test_suite("tests") { if (enable_fuzz_test_targets) { chip_fuzz_target("fuzz-chip-cert") { sources = [ "FuzzChipCert.cpp" ] - public_deps = [ "${chip_root}/src/credentials" ] + public_deps = [ + "${chip_root}/src/credentials", + "${chip_root}/src/platform/logging:default", + ] } } diff --git a/src/inet/tests/BUILD.gn b/src/inet/tests/BUILD.gn index 39b707c86c8452..151b08b7c18838 100755 --- a/src/inet/tests/BUILD.gn +++ b/src/inet/tests/BUILD.gn @@ -97,6 +97,7 @@ executable("inet-layer-test-tool") { "${chip_root}/src/inet", "${chip_root}/src/lib/core", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", ] output_dir = root_out_dir diff --git a/src/lib/BUILD.gn b/src/lib/BUILD.gn index 1e04c837749840..fc9d1289838f1c 100644 --- a/src/lib/BUILD.gn +++ b/src/lib/BUILD.gn @@ -13,9 +13,10 @@ # limitations under the License. import("//build_overrides/chip.gni") +import("${chip_root}/src/platform/device.gni") import("lib.gni") -static_library("lib") { +source_set("without-logging") { public_deps = [ "${chip_root}/src/app", "${chip_root}/src/ble", @@ -53,6 +54,13 @@ static_library("lib") { } cflags = [ "-Wconversion" ] +} + +static_library("lib") { + public_deps = [ + ":without-logging", + "${chip_root}/src/platform/logging:default", + ] output_name = "libCHIP" @@ -60,3 +68,17 @@ static_library("lib") { complete_static_lib = true } + +# This version of libCHIP is only meant for internal use by some test drivers +static_library("with-stdio-logging") { + public_deps = [ + ":without-logging", + "${chip_root}/src/platform/logging:stdio", + ] + + output_name = "libCHIPWithStdioLogging" + + output_dir = "${root_out_dir}/lib" + + complete_static_lib = true +} diff --git a/src/lib/core/tests/BUILD.gn b/src/lib/core/tests/BUILD.gn index 108d5112e8819b..94a6ace3636be1 100644 --- a/src/lib/core/tests/BUILD.gn +++ b/src/lib/core/tests/BUILD.gn @@ -52,6 +52,9 @@ chip_test_suite("tests") { if (enable_fuzz_test_targets) { chip_fuzz_target("fuzz-tlv-reader") { sources = [ "FuzzTlvReader.cpp" ] - public_deps = [ "${chip_root}/src/lib/core" ] + public_deps = [ + "${chip_root}/src/lib/core", + "${chip_root}/src/platform/logging:default", + ] } } diff --git a/src/lib/dnssd/minimal_mdns/tests/BUILD.gn b/src/lib/dnssd/minimal_mdns/tests/BUILD.gn index dc09e4b4b59d5d..17f9868609748c 100644 --- a/src/lib/dnssd/minimal_mdns/tests/BUILD.gn +++ b/src/lib/dnssd/minimal_mdns/tests/BUILD.gn @@ -46,6 +46,9 @@ chip_test_suite("tests") { if (enable_fuzz_test_targets) { chip_fuzz_target("fuzz-minmdns-packet-parsing") { sources = [ "FuzzPacketParsing.cpp" ] - public_deps = [ "${chip_root}/src/lib/dnssd/minimal_mdns" ] + public_deps = [ + "${chip_root}/src/lib/dnssd/minimal_mdns", + "${chip_root}/src/platform/logging:default", + ] } } diff --git a/src/messaging/tests/echo/BUILD.gn b/src/messaging/tests/echo/BUILD.gn index 666629562dc5cc..2a3947dc1ac0c7 100644 --- a/src/messaging/tests/echo/BUILD.gn +++ b/src/messaging/tests/echo/BUILD.gn @@ -43,6 +43,7 @@ executable("chip-echo-requester") { "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/protocols", "${chip_root}/src/system", ] @@ -58,6 +59,7 @@ executable("chip-echo-responder") { "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/protocols", "${chip_root}/src/system", ] diff --git a/src/messaging/tests/java/BUILD.gn b/src/messaging/tests/java/BUILD.gn index 8eff7a303824ff..b04e48c2224060 100644 --- a/src/messaging/tests/java/BUILD.gn +++ b/src/messaging/tests/java/BUILD.gn @@ -25,7 +25,10 @@ shared_library("jni") { output_name = "libCHIPMessaging" sources = [ "MessagingContext-JNI.cpp" ] - deps = [ "${chip_root}/src/messaging/tests:helpers" ] + deps = [ + "${chip_root}/src/messaging/tests:helpers", + "${chip_root}/src/platform/logging:default", + ] public_configs = [ "${chip_root}/src:includes" ] diff --git a/src/platform/ASR/BUILD.gn b/src/platform/ASR/BUILD.gn index 033f07e977835a..24a819f35f62eb 100755 --- a/src/platform/ASR/BUILD.gn +++ b/src/platform/ASR/BUILD.gn @@ -44,7 +44,6 @@ static_library("ASR") { "InetPlatformConfig.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "LwIPCoreLock.cpp", "NetworkCommissioningDriver.h", "NetworkCommissioningWiFiDriver.cpp", @@ -90,3 +89,11 @@ static_library("ASR") { ] } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Ameba/BUILD.gn b/src/platform/Ameba/BUILD.gn index 9e06191ae667ca..69bf149fee4a82 100755 --- a/src/platform/Ameba/BUILD.gn +++ b/src/platform/Ameba/BUILD.gn @@ -41,7 +41,6 @@ static_library("Ameba") { "FactoryDataProvider.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "LwIPCoreLock.cpp", "NetworkCommissioningDriver.h", "NetworkCommissioningWiFiDriver.cpp", @@ -74,3 +73,14 @@ static_library("Ameba") { ] } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ + "Logging.cpp", + "Logging.h", + ] +} diff --git a/src/platform/Beken/BUILD.gn b/src/platform/Beken/BUILD.gn index 75cbf7b96e09e6..903379b93608d3 100755 --- a/src/platform/Beken/BUILD.gn +++ b/src/platform/Beken/BUILD.gn @@ -39,7 +39,6 @@ static_library("Beken") { "DiagnosticDataProviderImpl.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "LwIPCoreLock.cpp", "NetworkCommissioningWiFiDriver.cpp", "OTAImageProcessorImpl.cpp", @@ -61,3 +60,11 @@ static_library("Beken") { "${chip_root}/src/platform:platform_base", ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Darwin/BUILD.gn b/src/platform/Darwin/BUILD.gn index a416e99e5b24d4..df4c0774e91627 100644 --- a/src/platform/Darwin/BUILD.gn +++ b/src/platform/Darwin/BUILD.gn @@ -65,7 +65,6 @@ static_library("Darwin") { "DnssdImpl.h", "DnssdType.cpp", "InetPlatformConfig.h", - "LoggingImpl.cpp", "MdnsError.cpp", "MdnsError.h", "NetworkCommissioningDriver.h", @@ -152,12 +151,14 @@ static_library("logging") { sources = [ "Logging.h", "Logging.mm", + "LoggingImpl.cpp", ] deps = [ "${chip_root}/src/lib/support:attributes", "${chip_root}/src/lib/support:logging_constants", "${chip_root}/src/lib/support:span", + "${chip_root}/src/platform/logging:headers", ] configs += [ "${chip_root}/src:includes" ] diff --git a/src/platform/ESP32/BUILD.gn b/src/platform/ESP32/BUILD.gn index 1b84a21b06d9d7..2d5d9449b2243e 100644 --- a/src/platform/ESP32/BUILD.gn +++ b/src/platform/ESP32/BUILD.gn @@ -55,7 +55,6 @@ static_library("ESP32") { "ESP32Utils.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "LwIPCoreLock.cpp", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", @@ -209,3 +208,11 @@ static_library("ESP32") { "-Wundef", ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Infineon/CYW30739/BUILD.gn b/src/platform/Infineon/CYW30739/BUILD.gn index 433b8dcdc49d9d..ec9aeeda99491c 100644 --- a/src/platform/Infineon/CYW30739/BUILD.gn +++ b/src/platform/Infineon/CYW30739/BUILD.gn @@ -38,6 +38,7 @@ static_library("CYW30739") { "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", "OTAImageProcessorImpl.h", + "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SystemPlatformConfig.h", "cyw30739-chip-mbedtls-config.h", @@ -88,3 +89,11 @@ static_library("CYW30739") { } } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Infineon/PSOC6/BUILD.gn b/src/platform/Infineon/PSOC6/BUILD.gn index 0d159bacf421c0..bc048a31d3a9b7 100644 --- a/src/platform/Infineon/PSOC6/BUILD.gn +++ b/src/platform/Infineon/PSOC6/BUILD.gn @@ -41,7 +41,6 @@ static_library("PSOC6") { "InetPlatformConfig.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "LwIPCoreLock.cpp", "MTBKeyValueStore.cpp", "MTBKeyValueStore.h", @@ -78,3 +77,11 @@ static_library("PSOC6") { "${chip_root}/src/platform:platform_base", ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn index d73a2dcb0fc13c..35b5047c9f4c00 100644 --- a/src/platform/Linux/BUILD.gn +++ b/src/platform/Linux/BUILD.gn @@ -79,11 +79,6 @@ static_library("Linux") { "${chip_root}/src/setup_payload", ] - if (!chip_use_external_logging) { - sources += [ "Logging.cpp" ] - deps += [ "${chip_root}/src/platform/logging:headers" ] - } - if (chip_enable_openthread) { sources += [ "NetworkCommissioningThreadDriver.cpp" ] } @@ -160,3 +155,16 @@ static_library("Linux") { public_deps += [ "dbus/bluez" ] } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + + if (chip_use_pw_logging) { + deps += [ "$dir_pw_log" ] + } + + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/NuttX/BUILD.gn b/src/platform/NuttX/BUILD.gn index aa63339eaac526..346c7d60ed0bdf 100644 --- a/src/platform/NuttX/BUILD.gn +++ b/src/platform/NuttX/BUILD.gn @@ -79,11 +79,6 @@ static_library("NuttX") { "${chip_root}/src/setup_payload", ] - if (!chip_use_external_logging) { - sources += [ "Logging.cpp" ] - deps += [ "${chip_root}/src/platform/logging:headers" ] - } - if (chip_enable_openthread) { sources += [ "NetworkCommissioningThreadDriver.cpp" ] } @@ -144,10 +139,6 @@ static_library("NuttX") { public_deps += [ "dbus/openthread" ] } - if (chip_use_pw_logging) { - deps += [ "$dir_pw_log" ] - } - if (chip_enable_wifi) { sources += [ "NetworkCommissioningWiFiDriver.cpp" ] @@ -158,3 +149,16 @@ static_library("NuttX") { public_deps += [ "dbus/bluez" ] } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + + if (chip_use_pw_logging) { + deps += [ "$dir_pw_log" ] + } + + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Tizen/BUILD.gn b/src/platform/Tizen/BUILD.gn index f2f972635a054d..1bd7af3bc0b35f 100644 --- a/src/platform/Tizen/BUILD.gn +++ b/src/platform/Tizen/BUILD.gn @@ -53,7 +53,6 @@ static_library("Tizen") { "InetPlatformConfig.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "NetworkCommissioningDriver.h", "NetworkCommissioningEthernetDriver.cpp", "PlatformManagerImpl.cpp", @@ -66,13 +65,11 @@ static_library("Tizen") { "SystemTimeSupport.cpp", ] - deps = [ - "${chip_root}/src/platform/logging:headers", - "${chip_root}/src/setup_payload", - ] + deps = [ "${chip_root}/src/setup_payload" ] public_deps = [ "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", "${tizen_root}:tizen", ] @@ -115,3 +112,12 @@ static_library("Tizen") { cflags = [ "-Wconversion" ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + "${tizen_root}:tizen", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/Zephyr/BUILD.gn b/src/platform/Zephyr/BUILD.gn index 425649e4d452ee..f271d2ea7edf74 100644 --- a/src/platform/Zephyr/BUILD.gn +++ b/src/platform/Zephyr/BUILD.gn @@ -41,7 +41,6 @@ static_library("Zephyr") { "InetPlatformConfig.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SysHeapMalloc.h", @@ -84,3 +83,11 @@ static_library("Zephyr") { cflags = [ "-Wconversion" ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/bouffalolab/BL602/BUILD.gn b/src/platform/bouffalolab/BL602/BUILD.gn index 5fd3aceff1deee..215131d87be32d 100644 --- a/src/platform/bouffalolab/BL602/BUILD.gn +++ b/src/platform/bouffalolab/BL602/BUILD.gn @@ -39,7 +39,6 @@ static_library("BL602") { "../common/ConnectivityManagerImpl.cpp", "../common/DiagnosticDataProviderImpl.cpp", "../common/KeyValueStoreManagerImpl.cpp", - "../common/Logging.cpp", "../common/PlatformManagerImpl.cpp", ] diff --git a/src/platform/bouffalolab/BL702/BUILD.gn b/src/platform/bouffalolab/BL702/BUILD.gn index 8582019df301e7..7bf2b615d42294 100644 --- a/src/platform/bouffalolab/BL702/BUILD.gn +++ b/src/platform/bouffalolab/BL702/BUILD.gn @@ -41,7 +41,6 @@ static_library("BL702") { "../common/ConnectivityManagerImpl.cpp", "../common/DiagnosticDataProviderImpl.cpp", "../common/KeyValueStoreManagerImpl.cpp", - "../common/Logging.cpp", "../common/PlatformManagerImpl.cpp", ] diff --git a/src/platform/bouffalolab/BL702L/BUILD.gn b/src/platform/bouffalolab/BL702L/BUILD.gn index 547b9c695730c5..d688878c6ceb82 100644 --- a/src/platform/bouffalolab/BL702L/BUILD.gn +++ b/src/platform/bouffalolab/BL702L/BUILD.gn @@ -39,7 +39,6 @@ static_library("BL702L") { "../common/ConnectivityManagerImpl.cpp", "../common/DiagnosticDataProviderImpl.cpp", "../common/KeyValueStoreManagerImpl.cpp", - "../common/Logging.cpp", "../common/PlatformManagerImpl.cpp", ] diff --git a/src/platform/bouffalolab/common/BUILD.gn b/src/platform/bouffalolab/common/BUILD.gn new file mode 100644 index 00000000000000..bf4c8cfa7778ab --- /dev/null +++ b/src/platform/bouffalolab/common/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn b/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn index 4ad1b10fdf9c60..0684d4eec8cde2 100644 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn +++ b/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn @@ -35,7 +35,6 @@ static_library("cc13x4_26x4") { "../DiagnosticDataProviderImpl.cpp", "../DiagnosticDataProviderImpl.h", "../KeyValueStoreManagerImpl.cpp", - "../Logging.cpp", "../PlatformManagerImpl.cpp", "../Random.c", "BlePlatformConfig.h", @@ -104,3 +103,12 @@ static_library("cc13x4_26x4") { } } } + +source_set("logging") { + deps = [ + ":cc13x4_26x4", # TODO: is this necessary? + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "../Logging.cpp" ] +} diff --git a/src/platform/cc32xx/BUILD.gn b/src/platform/cc32xx/BUILD.gn index 6dfa080ee610e1..1c29df463891bf 100644 --- a/src/platform/cc32xx/BUILD.gn +++ b/src/platform/cc32xx/BUILD.gn @@ -34,8 +34,6 @@ static_library("cc32xx") { "InetPlatformConfig.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - - #"Logging.cpp", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", @@ -56,3 +54,9 @@ static_library("cc32xx") { ] } } + +source_set("logging") { + sources = [ + #"Logging.cpp" + ] +} diff --git a/src/platform/logging/BUILD.gn b/src/platform/logging/BUILD.gn index 6039b101e20482..6b914cab7357d2 100644 --- a/src/platform/logging/BUILD.gn +++ b/src/platform/logging/BUILD.gn @@ -4,8 +4,85 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") +import("${chip_root}/src/lib/core/core.gni") +import("${chip_root}/src/lib/shell/shell_device.gni") import("${chip_root}/src/platform/device.gni") +source_set("default") { + if (!chip_use_external_logging) { + deps = [] + + if (chip_use_pw_logging) { + deps += [ "$dir_pw_log" ] + } + + if (chip_device_platform == "cyw30739") { + deps += [ "${chip_root}/src/platform/Infineon/CYW30739:logging" ] + } else if (chip_device_platform == "psoc6") { + deps += [ "${chip_root}/src/platform/Infineon/PSOC6:logging" ] + } else if (chip_device_platform == "cc32xx") { + deps += [ "${chip_root}/src/platform/cc32xx:logging" ] + } else if (chip_device_platform == "esp32") { + deps += [ "${chip_root}/src/platform/ESP32:logging" ] + } else if (chip_device_platform == "openiotsdk") { + deps += [ "${chip_root}/src/platform/openiotsdk:logging" ] + } else if (chip_device_platform == "mbed") { + deps += [ "${chip_root}/src/platform/mbed:logging" ] + } else if (chip_device_platform == "bl602" || + chip_device_platform == "bl702" || + chip_device_platform == "bl702l") { + deps += [ "${chip_root}/src/platform/bouffalolab/common:logging" ] + } else if (chip_device_platform == "mt793x") { + deps += [ "${chip_root}/src/platform/mt793x:logging" ] + } else if (chip_device_platform == "cc13x2_26x2") { + deps += [ "${chip_root}/src/platform/cc13xx_26xx/cc13x4_26x2:logging" ] + } else if (chip_device_platform == "cc13x4_26x4") { + deps += [ "${chip_root}/src/platform/cc13xx_26xx/cc13x4_26x4:logging" ] + } else if (chip_device_platform == "ameba") { + deps += [ "${chip_root}/src/platform/Ameba:logging" ] + } else if (chip_device_platform == "asr") { + deps += [ "${chip_root}/src/platform/ASR:logging" ] + } else if (chip_device_platform == "webos") { + deps += [ "${chip_root}/src/platform/webos:logging" ] + } else if (chip_device_platform == "zephyr" || + chip_device_platform == "nxp_zephyr") { + deps += [ "${chip_root}/src/platform/Zephyr:logging" ] + } else if (chip_device_platform == "nrfconnect") { + deps += [ "${chip_root}/src/platform/nrfconnect:logging" ] + } else if (chip_device_platform == "telink") { + deps += [ "${chip_root}/src/platform/telink:logging" ] + } else if (chip_device_platform == "efr32") { + deps += [ "${chip_root}/src/platform/silabs/efr32:logging" ] + } else if (chip_device_platform == "SiWx917") { + deps += [ "${chip_root}/src/platform/silabs/SiWx917:logging" ] + } else if (chip_device_platform == "linux") { + deps += [ "${chip_root}/src/platform/Linux:logging" ] + } else if (chip_device_platform == "tizen") { + deps += [ "${chip_root}/src/platform/Tizen:logging" ] + } else if (chip_device_platform == "qpg") { + deps += [ "${chip_root}/src/platform/qpg:logging" ] + } else if (chip_device_platform == "darwin") { + deps += [ "${chip_root}/src/platform/Darwin:logging" ] + } else if (chip_device_platform == "mw320") { + deps += [ "${chip_root}/src/platform/nxp/mw320:logging" ] + } else if (chip_device_platform == "k32w0" || + chip_device_platform == "k32w1" || + chip_device_platform == "nxp") { + deps += [ "${chip_root}/src/platform/nxp:logging" ] + } else if (chip_device_platform == "beken") { + deps += [ "${chip_root}/src/platform/Beken:logging" ] + } else if (chip_device_platform == "stm32") { + deps += [ ":stdio" ] + } else if (chip_device_platform == "nuttx") { + deps += [ "${chip_root}/src/platform/NuttX:logging" ] + } else { + assert( + chip_device_platform == "fake" || chip_device_platform == "android" || + chip_device_platform == "external") + } + } +} + source_set("headers") { public = [ "LogV.h" ] } @@ -31,7 +108,7 @@ if (current_os == "android") { # workaround, define a reasonable path and make the target use it. stdio_archive = "$root_out_dir/liblogging-stdio.a" -static_library("stdio") { +source_set("stdio") { if (chip_device_platform == "darwin") { sources = [ "impl/stdio/darwin/Logging.cpp" ] } else { @@ -53,16 +130,3 @@ static_library("stdio") { output_extension = get_path_info(stdio_archive, "extension") output_prefix_override = true } - -# Depending on this target (via public_deps) pulls in the stdio -# logger and ensures it takes precendce over the platform backend. -group("force_stdio") { - deps = [ ":stdio" ] - public_configs = [ ":force_stdio_config" ] -} - -config("force_stdio_config") { - # Ensure the linker sees the stdio implementation first. This - # works because ldflags come before inputs on the command line. - ldflags = [ rebase_path(stdio_archive, root_build_dir) ] -} diff --git a/src/platform/mbed/BUILD.gn b/src/platform/mbed/BUILD.gn index 6132390166ea01..f73a39f853109d 100644 --- a/src/platform/mbed/BUILD.gn +++ b/src/platform/mbed/BUILD.gn @@ -30,7 +30,6 @@ static_library("mbed") { "DiagnosticDataProviderImpl.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "MbedConfig.cpp", "MbedEventTimeout.cpp", "NetworkCommissioningDriver.h", @@ -51,3 +50,14 @@ static_library("mbed") { cflags = [ "-Wconversion" ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ + "Logging.cpp", + "Logging.h", + ] +} diff --git a/src/platform/mt793x/BUILD.gn b/src/platform/mt793x/BUILD.gn index 60ff46c35dc110..3071988a280e67 100644 --- a/src/platform/mt793x/BUILD.gn +++ b/src/platform/mt793x/BUILD.gn @@ -42,7 +42,6 @@ static_library("mt793x") { "DnssdImpl.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "MT793XConfig.cpp", "MT793XConfig.h", "MdnsError.cpp", @@ -80,3 +79,11 @@ static_library("mt793x") { ] } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index 5eb866391a0aff..9be90fe6b7b0da 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -29,7 +29,6 @@ static_library("nrfconnect") { "../Zephyr/DiagnosticDataProviderImpl.cpp", "../Zephyr/DiagnosticDataProviderImpl.h", "../Zephyr/KeyValueStoreManagerImpl.cpp", - "../Zephyr/Logging.cpp", "../Zephyr/PlatformManagerImpl.cpp", "../Zephyr/SysHeapMalloc.h", "../Zephyr/SystemTimeSupport.cpp", @@ -133,3 +132,11 @@ static_library("nrfconnect") { cflags = [ "-Wconversion" ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "../Zephyr/Logging.cpp" ] +} diff --git a/src/platform/nxp/BUILD.gn b/src/platform/nxp/BUILD.gn index b0bc61c43a960b..b60e57af6a4353 100644 --- a/src/platform/nxp/BUILD.gn +++ b/src/platform/nxp/BUILD.gn @@ -19,3 +19,16 @@ import("${nxp_sdk_build_root}/nxp_sdk.gni") group("nxp") { public_deps = [ "${chip_root}/src/platform/nxp/${nxp_platform}:nxp_platform" ] } + +source_set("logging") { + public_deps = [ + "${chip_root}/src/platform:platform", + "${chip_root}/src/platform/logging:headers", + ] + + if (nxp_platform == "k32w/k32w0" || nxp_platform == "k32w/k32w1") { + sources = [ "${chip_root}/src/platform/nxp/${nxp_platform}/Logging.cpp" ] + } else { + sources = [ "${chip_root}/src/platform/nxp/common/Logging.cpp" ] + } +} diff --git a/src/platform/nxp/k32w/k32w0/BUILD.gn b/src/platform/nxp/k32w/k32w0/BUILD.gn index c8aea6ee945f22..76af2760bc9051 100644 --- a/src/platform/nxp/k32w/k32w0/BUILD.gn +++ b/src/platform/nxp/k32w/k32w0/BUILD.gn @@ -46,7 +46,6 @@ static_library("nxp_platform") { "K32W0Config.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "NFCManagerImpl.cpp", "NFCManagerImpl.h", "PlatformManagerImpl.cpp", diff --git a/src/platform/nxp/k32w/k32w1/BUILD.gn b/src/platform/nxp/k32w/k32w1/BUILD.gn index 34dc5ca1b4e38a..028bd2a1cde4a1 100644 --- a/src/platform/nxp/k32w/k32w1/BUILD.gn +++ b/src/platform/nxp/k32w/k32w1/BUILD.gn @@ -52,7 +52,6 @@ static_library("nxp_platform") { "K32W1Config.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SystemTimeSupport.cpp", diff --git a/src/platform/nxp/mw320/BUILD.gn b/src/platform/nxp/mw320/BUILD.gn index cbae110382f1b0..6b2729b8474872 100644 --- a/src/platform/nxp/mw320/BUILD.gn +++ b/src/platform/nxp/mw320/BUILD.gn @@ -43,7 +43,6 @@ static_library("mw320") { "DiagnosticDataProviderImpl.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "MW320Config.cpp", "MW320Config.h", "NetworkCommissioningDriver.h", @@ -93,3 +92,11 @@ static_library("mw320") { public_deps += [ "${chip_root}/src/crypto" ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/nxp/rt/rw61x/BUILD.gn b/src/platform/nxp/rt/rw61x/BUILD.gn index 1b5d82adfbd04c..0e3558b8bf916a 100644 --- a/src/platform/nxp/rt/rw61x/BUILD.gn +++ b/src/platform/nxp/rt/rw61x/BUILD.gn @@ -65,7 +65,6 @@ static_library("nxp_platform") { "../../common/DiagnosticDataProviderImpl.h", "../../common/KeyValueStoreManagerImpl.cpp", "../../common/KeyValueStoreManagerImpl.h", - "../../common/Logging.cpp", "../../common/NXPConfig.h", "../../common/NetworkProvisioningServerImpl.h", "../../common/PlatformManagerImpl.h", diff --git a/src/platform/nxp/zephyr/BUILD.gn b/src/platform/nxp/zephyr/BUILD.gn index bdf1f2bba9d324..291b84d3b03b29 100644 --- a/src/platform/nxp/zephyr/BUILD.gn +++ b/src/platform/nxp/zephyr/BUILD.gn @@ -30,7 +30,6 @@ static_library("nxp_zephyr") { "../../Zephyr/DiagnosticDataProviderImpl.cpp", "../../Zephyr/DiagnosticDataProviderImpl.h", "../../Zephyr/KeyValueStoreManagerImpl.cpp", - "../../Zephyr/Logging.cpp", "../../Zephyr/PlatformManagerImpl.cpp", "../../Zephyr/SysHeapMalloc.h", "../../Zephyr/SystemTimeSupport.cpp", diff --git a/src/platform/openiotsdk/BUILD.gn b/src/platform/openiotsdk/BUILD.gn index ec530f728eda0d..51ffe33bbe8e32 100644 --- a/src/platform/openiotsdk/BUILD.gn +++ b/src/platform/openiotsdk/BUILD.gn @@ -58,8 +58,6 @@ static_library("openiotsdk") { "KVPsaPsStore.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", - "Logging.h", "NetworkCommissioningDriver.h", "NetworkCommissioningEthernetDriver.cpp", "OpenIoTSDKArchUtils.c", @@ -87,3 +85,12 @@ static_library("openiotsdk") { cflags = [ "-Wconversion" ] } + +source_set("logging") { + public_deps = [ + ":openiotsdk", + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "${chip_root}/src/platform/openiotsdk/Logging.cpp" ] +} diff --git a/src/platform/openiotsdk/Logging.cpp b/src/platform/openiotsdk/Logging.cpp index fad4c8470221c0..2d3eb359bfd65e 100644 --- a/src/platform/openiotsdk/Logging.cpp +++ b/src/platform/openiotsdk/Logging.cpp @@ -81,13 +81,6 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) DeviceLayer::OnLogOutput(); } -void ois_logging_init() -{ -#if defined(NDEBUG) && CHIP_CONFIG_TEST == 0 - SetLogFilter(LogCategory::kLogCategory_Progress); -#endif -} - } // namespace Platform } // namespace Logging } // namespace chip diff --git a/src/platform/openiotsdk/Logging.h b/src/platform/openiotsdk/Logging.h deleted file mode 100644 index cd34e5206cd58a..00000000000000 --- a/src/platform/openiotsdk/Logging.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation of logging support - * for Open IOT SDK platform. - */ - -#pragma once - -#include - -namespace chip { -namespace Logging { -namespace Platform { - -void ois_logging_init(void); - -} // namespace Platform -} // namespace Logging -} // namespace chip diff --git a/src/platform/qpg/BUILD.gn b/src/platform/qpg/BUILD.gn index 1087c6d06677c8..d9983ae6bcec66 100644 --- a/src/platform/qpg/BUILD.gn +++ b/src/platform/qpg/BUILD.gn @@ -41,7 +41,6 @@ static_library("qpg") { "FactoryDataProvider.cpp", "FactoryDataProvider.h", "InetPlatformConfig.h", - "Logging.cpp", "OTAImageProcessorImpl.cpp", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", @@ -90,3 +89,11 @@ static_library("qpg") { } } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/platform/silabs/SiWx917/BUILD.gn b/src/platform/silabs/SiWx917/BUILD.gn index 9187ce8f3d4286..27df228be44222 100644 --- a/src/platform/silabs/SiWx917/BUILD.gn +++ b/src/platform/silabs/SiWx917/BUILD.gn @@ -47,7 +47,6 @@ static_library("SiWx917") { "${silabs_platform_dir}/InetPlatformConfig.h", "${silabs_platform_dir}/KeyValueStoreManagerImpl.cpp", "${silabs_platform_dir}/KeyValueStoreManagerImpl.h", - "${silabs_platform_dir}/Logging.cpp", "${silabs_platform_dir}/MigrationManager.cpp", "${silabs_platform_dir}/MigrationManager.h", "${silabs_platform_dir}/PlatformManagerImpl.cpp", @@ -98,3 +97,11 @@ static_library("SiWx917") { ] public_configs = [ ":siwx917-platform-wifi-config" ] } + +source_set("logging") { + sources = [ "${chip_root}/src/platform/silabs/Logging.cpp" ] + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] +} diff --git a/src/platform/silabs/efr32/BUILD.gn b/src/platform/silabs/efr32/BUILD.gn index 462c32af4d871d..3d1510d5029d9e 100644 --- a/src/platform/silabs/efr32/BUILD.gn +++ b/src/platform/silabs/efr32/BUILD.gn @@ -53,7 +53,6 @@ static_library("efr32") { "${silabs_platform_dir}/InetPlatformConfig.h", "${silabs_platform_dir}/KeyValueStoreManagerImpl.cpp", "${silabs_platform_dir}/KeyValueStoreManagerImpl.h", - "${silabs_platform_dir}/Logging.cpp", "${silabs_platform_dir}/MigrationManager.cpp", "${silabs_platform_dir}/PlatformManagerImpl.cpp", "${silabs_platform_dir}/PlatformManagerImpl.h", @@ -95,8 +94,11 @@ static_library("efr32") { ] } - public_deps = [ "${chip_root}/src/platform:platform_base" ] - deps = [ "${chip_root}/src/platform/logging:headers" ] + public_deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + deps = [] # Add platform crypto implementation if (chip_crypto == "platform") { @@ -161,3 +163,11 @@ static_library("efr32") { public_configs = [ ":efr32-platform-wifi-config" ] } } + +source_set("logging") { + sources = [ "${chip_root}/src/platform/silabs/Logging.cpp" ] + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] +} diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index 4d97b41bc2f0ef..4857c048afc178 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -116,3 +116,11 @@ static_library("telink") { ] } } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "../Zephyr/Logging.cpp" ] +} diff --git a/src/platform/webos/BUILD.gn b/src/platform/webos/BUILD.gn index b2510a3040df95..503bd216c4e816 100644 --- a/src/platform/webos/BUILD.gn +++ b/src/platform/webos/BUILD.gn @@ -86,7 +86,6 @@ static_library("webos") { "InetPlatformConfig.h", "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", - "Logging.cpp", "MainLoop.cpp", "MainLoop.h", "NetworkCommissioningDriver.h", @@ -153,3 +152,11 @@ static_library("webos") { "pbnjson_cpp", ] } + +source_set("logging") { + deps = [ + "${chip_root}/src/platform:platform_base", + "${chip_root}/src/platform/logging:headers", + ] + sources = [ "Logging.cpp" ] +} diff --git a/src/pybindings/pycontroller/BUILD.gn b/src/pybindings/pycontroller/BUILD.gn index 032d3bc5a94810..0949f7baf7661a 100644 --- a/src/pybindings/pycontroller/BUILD.gn +++ b/src/pybindings/pycontroller/BUILD.gn @@ -67,6 +67,7 @@ shared_library("CHIPController") { "${chip_root}/src/lib/dnssd", "${chip_root}/src/lib/support", "${chip_root}/src/platform", + "${chip_root}/src/platform/logging:default", "${chip_root}/src/setup_payload", "${chip_root}/src/tracing/json", "${chip_root}/src/tracing/perfetto", diff --git a/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt b/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt index 76247fb31c71e4..5ca20e4fff6b7f 100644 --- a/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt +++ b/src/test_driver/openiotsdk/unit-tests/CMakeLists.txt @@ -28,6 +28,7 @@ set(CONFIG_CHIP_DETAIL_LOGGING NO) set(CONFIG_CHIP_PROGRESS_LOGGING NO) set(CONFIG_CHIP_AUTOMATION_LOGGING YES) set(CONFIG_CHIP_ERROR_LOGGING NO) +set(CONFIG_CHIP_FORCE_LOGGING_STDIO YES) # Toolchain files need to exist before first call to project include(toolchain)