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 <sjg@chromium.org>
This commit is contained in:
Simon Glass 2018-10-01 11:55:11 -06:00
parent 69bc15d5ff
commit 2b1dc29a12
3 changed files with 16 additions and 1 deletions

View file

@ -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;