Skip to content

Commit

Permalink
Missing log function in Zephyr standalone platform (#34413)
Browse files Browse the repository at this point in the history
* Add missing log option

Signed-off-by: Caldeira, Quentin <[email protected]>

* Add missing logging Kconfig

I've created this one with the previous PR, but I didn't see that it was ignored by .gitignore because
I named it Kconfig.log, so rename it to Kconfig.logging

Always with the purpose to separate each function in a dedicated Kconfig to source in your application, to avoid
Kconfig warning, and let your prj.conf be application configuration only

Signed-off-by: Caldeira, Quentin <[email protected]>

* Move CHIP_APP_LOG_LEVEL

Because every zephyr's user seems to rely on the zephyr logging system, move the log declaration into the zephyr
folder

Signed-off-by: Caldeira, Quentin <[email protected]>

---------

Signed-off-by: Caldeira, Quentin <[email protected]>
  • Loading branch information
QuentinCaldeira-eaton authored and pull[bot] committed Oct 2, 2024
1 parent 48e2761 commit 5c7a73d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 27 deletions.
9 changes: 0 additions & 9 deletions config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ config CHIP_NRF_PLATFORM
config CHIP_DEVICE_VENDOR_NAME
default "Nordic Semiconductor ASA"

config CHIP_APP_LOG_LEVEL
int "Logging level in application"
default LOG_DEFAULT_LEVEL
depends on LOG
help
Sets the logging level in the Matter application. Use this configuration
option only within the application. To set the logging level for the
Matter stack, use the MATTER_LOG_LEVEL configuration option.

config CHIP_NFC_COMMISSIONING
bool "Share onboarding payload in NFC tag"
default n
Expand Down
9 changes: 0 additions & 9 deletions config/nxp/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ config CHIP_NXP_PLATFORM
config CHIP_DEVICE_VENDOR_NAME
default "NXP Semiconductors"

config CHIP_APP_LOG_LEVEL
int "Logging level in application"
default LOG_DEFAULT_LEVEL
depends on LOG
help
Sets the logging level in the Matter application. Use this configuration
option only within the application. To set the logging level for the
Matter stack, use the MATTER_LOG_LEVEL configuration option.

config CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
bool "Include default device information provider build"
default y
Expand Down
9 changes: 0 additions & 9 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ if CHIP
config CHIP_DEVICE_VENDOR_NAME
default "Telink Semiconductor"

config CHIP_APP_LOG_LEVEL
int "Logging level in application"
default LOG_DEFAULT_LEVEL
depends on LOG
help
Sets the logging level in the Matter application. Use this configuration
option only within the application. To set the logging level for the
Matter stack, use the MATTER_LOG_LEVEL configuration option.

config CHIP_NFC_COMMISSIONING
bool "Share onboarding payload in NFC tag"
default n
Expand Down
9 changes: 9 additions & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ menuconfig CHIP

if CHIP

config CHIP_APP_LOG_LEVEL
int "Logging level in application"
default LOG_DEFAULT_LEVEL
depends on LOG
help
Sets the logging level in the Matter application. Use this configuration
option only within the application. To set the logging level for the
Matter stack, use the MATTER_LOG_LEVEL configuration option.

# Device and firmware identifers

config CHIP_DEVICE_VENDOR_ID
Expand Down
41 changes: 41 additions & 0 deletions config/zephyr/chip-module/Kconfig.logging
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Copyright (c) 2021 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.
#

config LOG
default y

if LOG

choice LOG_MODE
default LOG_MODE_MINIMAL
endchoice

choice MATTER_LOG_LEVEL_CHOICE
default MATTER_LOG_LEVEL_DBG
endchoice

config CHIP_APP_LOG_LEVEL
default 4 # debug

config LOG_DEFAULT_LEVEL
default 1 # error

# disable synchronous printk to avoid blocking IRQs which
# may affect time sensitive components
config PRINTK_SYNC
default n

endif # LOG

0 comments on commit 5c7a73d

Please sign in to comment.