From: Simon Glass Date: Sat, 16 Feb 2019 20:24:35 -0700 Subject: [U-Boot] [PATCH v2 02/34] log: Add a Kconfig option to set the default log level In-Reply-To: <20190217032507.124320-1-sjg@chromium.org> References: <20190217032507.124320-1-sjg@chromium.org> Message-ID: <20190217032507.124320-3-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Bin Meng --- Changes in v2: - Add the log-level names into the Kconfig help - Correct the default log level to 6 (LOGL_INFO) common/Kconfig | 20 ++++++++++++++++++++ common/log.c | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/common/Kconfig b/common/Kconfig index 849d8ff90ad..e100c229496 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 ec14644516c..ffb3cd69332 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; -- 2.21.0.rc0.258.g878e2cd30e-goog