[PATCH v2 2/3] commands: test: replace printf with pr_err

Sascha Hauer sha at pengutronix.de
Tue Jul 4 04:38:03 PDT 2023


On Tue, Jul 04, 2023 at 01:29:20PM +0200, Marco Felsch wrote:
> Replace the printf() with pr_err() to support:
>  - color formated prints
>  - logbuffer storing (dmesg)
>  - loglevels
> 
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
> ---
> v2:
>  - new patch
> 
>  commands/test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/commands/test.c b/commands/test.c
> index c1b84c42ef..5478011185 100644
> --- a/commands/test.c
> +++ b/commands/test.c
> @@ -77,7 +77,7 @@ static int do_test(int argc, char *argv[])
>  	if (*argv[0] == '[') {
>  		argc--;
>  		if (*argv[argc] != ']') {
> -			printf("[: missing `]'\n");
> +			pr_err("[: missing `]'\n");

Logging functions pr_* and dev_* should be used for core and driver
messages, commands should use printf. The line between logging functions
and commands is not always clear in barebox, but here it is.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list