logging: Minimal mode configuration cleanup

Remove LOG_MINIMAL kconfig option which was confusing
since LOG_MODE_MINIMAL existed. LOG_MINIMAL was used to
force minimal mode but because of invalid dependencies
it was leading to issues.

Refactored code to use LOG_MODE_MINIMAL everywhere and
renamed LOG_MINIMAL to LOG_DEFAULT_MINIMAL which has impact
on defualt logging mode (which still can be later changed
in conf file or in menuconfig).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-11-19 07:59:23 +01:00 committed by Anas Nashif
commit c0808e3f59
13 changed files with 23 additions and 24 deletions

View file

@ -289,7 +289,7 @@ static inline void log_printk(const char *fmt, va_list ap)
char *z_log_strdup(const char *str);
static inline char *log_strdup(const char *str)
{
if (IS_ENABLED(CONFIG_LOG_MINIMAL) || IS_ENABLED(CONFIG_LOG2)) {
if (IS_ENABLED(CONFIG_LOG_MODE_MINIMAL) || IS_ENABLED(CONFIG_LOG2)) {
return (char *)str;
}

View file

@ -33,7 +33,7 @@ extern "C" {
#define CONFIG_LOG_MAX_LEVEL 0U
#endif
#if !defined(CONFIG_LOG) || defined(CONFIG_LOG_MINIMAL)
#if !defined(CONFIG_LOG) || defined(CONFIG_LOG_MODE_MINIMAL)
#define CONFIG_LOG_DOMAIN_ID 0U
#endif
@ -299,7 +299,7 @@ static inline char z_log_minimal_level_to_char(int level)
if (!Z_LOG_CONST_LEVEL_CHECK(_level)) { \
break; \
} \
if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \
if (IS_ENABLED(CONFIG_LOG_MODE_MINIMAL)) { \
Z_LOG_TO_PRINTK(_level, __VA_ARGS__); \
break; \
} \
@ -353,7 +353,7 @@ static inline char z_log_minimal_level_to_char(int level)
uint32_t filters = IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
(_dsource)->filters : 0;\
\
if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \
if (IS_ENABLED(CONFIG_LOG_MODE_MINIMAL)) { \
Z_LOG_TO_PRINTK(_level, "%s", _str); \
z_log_minimal_hexdump_print(_level, \
(const char *)_data, _len);\
@ -471,7 +471,7 @@ enum log_strdup_action {
};
#define Z_LOG_PRINTK(...) do { \
if (IS_ENABLED(CONFIG_LOG_MINIMAL) || !IS_ENABLED(CONFIG_LOG2)) { \
if (IS_ENABLED(CONFIG_LOG_MODE_MINIMAL) || !IS_ENABLED(CONFIG_LOG2)) { \
z_log_minimal_printk(__VA_ARGS__); \
break; \
} \
@ -731,7 +731,7 @@ __syscall void z_log_hexdump_from_user(uint32_t src_level_val,
if (!Z_LOG_CONST_LEVEL_CHECK(_level)) { \
break; \
} \
if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \
if (IS_ENABLED(CONFIG_LOG_MODE_MINIMAL)) { \
Z_LOG_TO_VPRINTK(_level, _str, _valist); \
break; \
} \
@ -778,7 +778,7 @@ static inline log_arg_t z_log_do_strdup(uint32_t msk, uint32_t idx,
log_arg_t param,
enum log_strdup_action action)
{
#ifndef CONFIG_LOG_MINIMAL
#ifndef CONFIG_LOG_MODE_MINIMAL
char *z_log_strdup(const char *str);
if (msk & (1 << idx)) {

View file

@ -189,7 +189,7 @@ uint32_t log_get_strdup_pool_utilization(void);
*/
uint32_t log_get_strdup_longest_string(void);
#if defined(CONFIG_LOG) && !defined(CONFIG_LOG_MINIMAL)
#if defined(CONFIG_LOG) && !defined(CONFIG_LOG_MODE_MINIMAL)
#define LOG_CORE_INIT() log_core_init()
#define LOG_INIT() log_init()
#define LOG_PANIC() log_panic()