($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz at gmail.com>
To: ell at lists.01.org
Subject: Re: [PATCH 1/3] dhcp: Add priority to logging
Date: Tue, 17 May 2022 11:40:14 -0500	[thread overview]
Message-ID: <e1a8c1c0-b206-ee69-130a-a13aff9e290a@gmail.com> (raw)
In-Reply-To: 20220517161831.126597-1-mjohnson459@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]

Hi Michael,

On 5/17/22 11:18, Michael Johnson wrote:
> Most dhcp clients have some logging to show what state the lease is in
> so this just makes iwd more in line with them. The logging won't be
> enabled by default but requires a max logging level to be passed in when
> logging is set up.
> ---
>   ell/dhcp.c | 64 +++++++++++++++++++++++++++++-------------------------
>   ell/dhcp.h |  2 +-
>   2 files changed, 35 insertions(+), 31 deletions(-)
> 

<snip>

Looks good to me.  I have a few nits below, which I can probably fix myself if 
you feel lazy :)

Do you want to send a patch for iwd as well?

>   
> -#define CLIENT_DEBUG(fmt, args...)					\
> -	l_util_debug(client->debug_handler, client->debug_data,		\
> -			"%s:%i " fmt, __func__, __LINE__, ## args)
> +#define CLIENT_DEBUG(priority, fmt, args...)					\
> +	if (priority <= client->debug_level)		\
> +		l_util_debug(client->debug_handler, client->debug_data,		\
> +				"%s:%i " fmt, __func__, __LINE__, ## args)

Looks like there's one tab too many before all the '\'.

>   #define CLIENT_ENTER_STATE(s)						\
>   	l_util_debug(client->debug_handler, client->debug_data,		\
>   			"%s:%i Entering state: " #s,			\

<snip>

> @@ -425,14 +428,14 @@ static int dhcp_client_send_request(struct l_dhcp_client *client)
>   		if (!_dhcp_message_builder_append(&builder,
>   					L_DHCP_OPTION_SERVER_IDENTIFIER,
>   					4, &client->lease->server_address)) {
> -			CLIENT_DEBUG("Failed to append server ID");
> +			CLIENT_DEBUG(L_LOG_WARNING, "Failed to append server ID");

Can we split this to multiple lines to avoid lines that are >80 chars? 
Something like
	CLIENT_DEBUG(L_LOG_WARNING,\n
			"<Message to print>",
			arg1, .. argn);

See doc/coding-style.txt item M4.

For strings that don't fit on a single line, it is fine to go over 80 chars.

Alternatively we could add CLIENT_WARN, CLIENT_INFO, etc

>   			return -EINVAL;
>   		}
>   

Regards,
-Denis

             reply	other threads:[~2022-05-17 16:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 16:40 Denis Kenzior [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-17 16:18 [PATCH 1/3] dhcp: Add priority to logging Michael Johnson

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=e1a8c1c0-b206-ee69-130a-a13aff9e290a@gmail.com \
    --to=ell@lists.linux.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).