Skip to content

Commit dc9c5fc

Browse files
nordic-krchcarlescufi
authored andcommitted
logging: Add option LOG_MSG_APPEND_RO_STRING_LOC
Bring back Kconfig option which was previously removed by 9cd5086 (previously named LOG_MSG_PKG_ALWAYS_ADD_RO_STRING_IDXS). Renamed to shorten and be more descriptive. It can be useful for external backends or frontends. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
1 parent f87acb5 commit dc9c5fc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/zephyr/logging/log_msg.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ enum z_log_msg_mode {
139139
}
140140

141141
#define Z_LOG_MSG2_CBPRINTF_FLAGS(_cstr_cnt) \
142-
(CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(_cstr_cnt))
142+
(CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(_cstr_cnt) | \
143+
(IS_ENABLED(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC) ? \
144+
CBPRINTF_PACKAGE_ADD_STRING_IDXS : 0))
143145

144146
#ifdef CONFIG_LOG_USE_VLA
145147
#define Z_LOG_MSG2_ON_STACK_ALLOC(ptr, len) \

subsys/logging/Kconfig.misc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,11 @@ config LOG_MEM_UTILIZATION
7474
config LOG_DICTIONARY_DB
7575
bool
7676

77+
config LOG_MSG_APPEND_RO_STRING_LOC
78+
bool
79+
help
80+
Enable this option to force log messages to always append location of
81+
read-only string arguments in the package. This should be selected by
82+
backends if required.
83+
7784
endmenu

0 commit comments

Comments
 (0)