summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-02-16 20:24:35 -0700
committerBin Meng <bmeng.cn@gmail.com>2019-02-20 15:21:44 +0800
commitf0b05c95e3906fc25989e245b421dc5ec6becd72 (patch)
tree1c6ea36437008f7fcf26e1da41c6526d8fda56db /common
parent6fc7e93896e980d8eebf9cff46501f495a1fc361 (diff)
downloadu-boot-f0b05c95e3906fc25989e245b421dc5ec6becd72.tar.gz
u-boot-f0b05c95e3906fc25989e245b421dc5ec6becd72.tar.bz2
u-boot-f0b05c95e3906fc25989e245b421dc5ec6becd72.zip
log: Add a Kconfig option to set the default log level
At present the default log level is set to LOGL_INFO on start-up. Allow this to be controlled from Kconfig. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig20
-rw-r--r--common/log.c2
2 files changed, 21 insertions, 1 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 849d8ff90a..e100c22949 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -535,6 +535,26 @@ config TPL_LOG_MAX_LEVEL
8 - debug content
9 - debug hardware I/O
+config LOG_DEFAULT_LEVEL
+ int "Default logging level to display"
+ default 6
+ help
+ This is the default logging level set when U-Boot starts. It can
+ be adjusted later using the 'log level' command. Note that setting
+ this to a value abnove LOG_MAX_LEVEL will be ineffective, since the
+ higher levels are not compiled in to U-Boot.
+
+ 0 - emergency
+ 1 - alert
+ 2 - critical
+ 3 - error
+ 4 - warning
+ 5 - note
+ 6 - info
+ 7 - debug
+ 8 - debug content
+ 9 - debug hardware I/O
+
config LOG_CONSOLE
bool "Allow log output to the console"
depends on LOG
diff --git a/common/log.c b/common/log.c
index ec14644516..ffb3cd6933 100644
--- a/common/log.c
+++ b/common/log.c
@@ -316,7 +316,7 @@ int log_init(void)
}
gd->flags |= GD_FLG_LOG_READY;
if (!gd->default_log_level)
- gd->default_log_level = LOGL_INFO;
+ gd->default_log_level = CONFIG_LOG_DEFAULT_LEVEL;
gd->log_fmt = LOGF_DEFAULT;
return 0;