From: Simon Glass Date: Mon, 21 Jan 2019 18:12:38 -0700 Subject: [U-Boot] [PATCH 01/33] log: Add a Kconfig option to set the default log level In-Reply-To: <20190122011310.186491-1-sjg@chromium.org> References: <20190122011310.186491-1-sjg@chromium.org> Message-ID: <20190122011310.186491-2-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 --- common/Kconfig | 9 +++++++++ common/log.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/Kconfig b/common/Kconfig index 0a14bdedaa..2ee48e4a2a 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -527,6 +527,15 @@ config TPL_LOG_MAX_LEVEL 6 - detail 7 - debug +config LOG_DEFAULT_LEVEL + int "Default logging level to display" + default 5 + 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. + 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; -- 2.20.1.321.g9e740568ce-goog