From 2b1dc29a12e7a5256577c30a2389a6807d6d2bb6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 1 Oct 2018 11:55:11 -0600 Subject: sandbox: Add a flag to set the default log level It is useful to be able to set the default log level from the command line when running sandbox. Add a new -L command-line flag for this. The log level is set using the enum log_level_t in log.h. At present a number must be specified, e.g. -L7 for debug. Signed-off-by: Simon Glass --- common/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/log.c') diff --git a/common/log.c b/common/log.c index 59869cd29da..ec14644516c 100644 --- a/common/log.c +++ b/common/log.c @@ -315,7 +315,8 @@ int log_init(void) drv++; } gd->flags |= GD_FLG_LOG_READY; - gd->default_log_level = LOGL_INFO; + if (!gd->default_log_level) + gd->default_log_level = LOGL_INFO; gd->log_fmt = LOGF_DEFAULT; return 0; -- cgit v1.2.3