mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 2/3] commands: test: replace printf with pr_err
Date: Tue, 4 Jul 2023 13:59:47 +0200	[thread overview]
Message-ID: <20230704115947.pwrt6gc5bsjeif5l@pengutronix.de> (raw)
In-Reply-To: <20230704113803.GB18491@pengutronix.de>

On 23-07-04, Sascha Hauer wrote:
> 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@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.

Okay, thanks for clarification. I will drop the patch and send a v3.

Regards,
  Marco

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



  reply	other threads:[~2023-07-04 12:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 11:29 [PATCH v2 1/3] commands: test: simplify argv handling Marco Felsch
2023-07-04 11:29 ` [PATCH v2 2/3] commands: test: replace printf with pr_err Marco Felsch
2023-07-04 11:38   ` Sascha Hauer
2023-07-04 11:59     ` Marco Felsch [this message]
2023-07-04 11:29 ` [PATCH v2 3/3] commands: test: add based support for bash-test style Marco Felsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230704115947.pwrt6gc5bsjeif5l@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox