zephyr/subsys/logging/Kconfig.template.log_config_inherit
Théo Battrel ff5b8f003e Logging: Add Kconfig template for log inheriting
Add a new Kconfig template that allow log modules to inherit their log
level from their parent module.
For example, the logs used in the Bluetooth audio like
`BT_AUDIO_STREAM_LOG_LEVEL` can inherit their level from
`BT_AUDIO_LOG_LEVEL`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-30 14:37:58 +01:00

28 lines
719 B
Plaintext

# Copyright (c) 2022 Nordic Semicoductor ASA
# SPDX-License-Identifier: Apache-2.0
# Usage:
# This template allow module to use the parent module log level by default.
#
# The following arguments are mandatory:
# - module:
# Name of the new log module.
# Example: "BT_HCI_CORE"
# - parent-module:
# Name of the module that will be inherited by the new module.
# Example: "BT"
choice "$(module)_LOG_LEVEL_CHOICE"
default $(module)_LOG_LEVEL_INHERIT if y
config $(module)_LOG_LEVEL_INHERIT
bool "Inherit $(parent-module)_LOG_LEVEL"
endchoice
config $(module)_LOG_LEVEL
default $(parent-module)_LOG_LEVEL if $(module)_LOG_LEVEL_INHERIT
module := $(module)
source "subsys/logging/Kconfig.template.log_config"