2 * Copyright (c) 2017 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
13 static int do_log_level(cmd_tbl_t *cmdtp, int flag, int argc,
17 gd->default_log_level = simple_strtol(argv[1], NULL, 10);
19 printf("Default log level: %d\n", gd->default_log_level);
24 static cmd_tbl_t log_sub[] = {
25 U_BOOT_CMD_MKENT(level, CONFIG_SYS_MAXARGS, 1, do_log_level, "", ""),
26 #ifdef CONFIG_LOG_TEST
27 U_BOOT_CMD_MKENT(test, 2, 1, do_log_test, "", ""),
31 static int do_log(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
38 /* drop initial "log" arg */
42 cp = find_cmd_tbl(argv[0], log_sub, ARRAY_SIZE(log_sub));
44 return cp->cmd(cmdtp, flag, argc, argv);
49 #ifdef CONFIG_SYS_LONGHELP
50 static char log_help_text[] =
51 "level - get/set log level\n"
52 #ifdef CONFIG_LOG_TEST
53 "log test - run log tests\n"
59 log, CONFIG_SYS_MAXARGS, 1, do_log,
60 "log system", log_help_text