diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-06-17 21:52:44 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-09 18:57:22 -0600 |
commit | 3c21d7738a793bb7713df5ac4de434c680fa249f (patch) | |
tree | ed06f563175b03bbecf4a42df12a6b58add6e592 /include/log.h | |
parent | 8af45b1f20f7f56a872297873f793655fe37f8e3 (diff) |
log: don't show function by default
The name of the function emitting a log message may be of interest for a
developer but is distracting for normal users. See the example below:
try_load_entry() Booting: Debian
Make the default format for log messages customizable. By default show
only the message text.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/log.h')
-rw-r--r-- | include/log.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/log.h b/include/log.h index df65398c04..2859ce1f2e 100644 --- a/include/log.h +++ b/include/log.h @@ -12,6 +12,7 @@ #include <stdio.h> #include <linker_lists.h> #include <dm/uclass-id.h> +#include <linux/bitops.h> #include <linux/list.h> struct cmd_tbl; @@ -411,7 +412,6 @@ enum log_fmt { LOGF_MSG, LOGF_COUNT, - LOGF_DEFAULT = (1 << LOGF_FUNC) | (1 << LOGF_MSG), LOGF_ALL = 0x3f, }; @@ -460,4 +460,20 @@ static inline int log_init(void) } #endif +/** + * log_get_default_format() - get default log format + * + * The default log format is configurable via + * CONFIG_LOGF_FILE, CONFIG_LOGF_LINE, CONFIG_LOGF_FUNC. + * + * Return: default log format + */ +static inline int log_get_default_format(void) +{ + return BIT(LOGF_MSG) | + (IS_ENABLED(CONFIG_LOGF_FILE) ? BIT(LOGF_FILE) : 0) | + (IS_ENABLED(CONFIG_LOGF_LINE) ? BIT(LOGF_LINE) : 0) | + (IS_ENABLED(CONFIG_LOGF_FUNC) ? BIT(LOGF_FUNC) : 0); +} + #endif |