Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: James Prestwood <prestwoj@gmail.com>
Cc: iwd@lists.linux.dev
Subject: Re: [RFC 5/5] doc: document use of l_log APIs
Date: Wed, 14 Feb 2024 20:49:59 +0100	[thread overview]
Message-ID: <1DB84D8A-74F6-43EC-9E27-A477FD343F0E@holtmann.org> (raw)
In-Reply-To: <20240214193743.963349-6-prestwoj@gmail.com>

Hi James,

> With the introduction of l_notice in IWD some guidelines need to be
> set for l_info, l_warn, l_error, l_debug and l_notice.
> ---
> doc/coding-style.txt | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
> 
> diff --git a/doc/coding-style.txt b/doc/coding-style.txt
> index bf0535c5..fdd9e0e3 100644
> --- a/doc/coding-style.txt
> +++ b/doc/coding-style.txt
> @@ -317,6 +317,30 @@ Functions that are static should not be forward-declared.  The only exception
> to this rule is if a circular dependency condition exists, and the forward
> declaration cannot be avoided.
> 
> +M18: Use appropriate logging levels
> +===================================
> +An appropriate log level should be used depending on the type of message
> +being logged. Logging is done using the l_log APIs in ELL:
> +
> +l_info    Information that is expected during normal operation. l_info's use
> +          should be very limited so non-debug logs are concise
> +l_warn    An unexpected, but non-fatal condition ocurred
> +l_error   An unexpected condition ocurred. These are generally fatal to the
> +          current connection/protocol that is running but not generally to IWD's
> +          overall operation.
> +l_debug   General debugging. These can be used relatively freely but should
> +          provide some piece of useful information.
> +l_notice  Reserved for specific event-type notifications about IWD's internal
> +          state. These are logs that are mean to be both human-readable and
> +          parsed by tooling so they are required to be of a certain syntax. They
> +          should start with "event: <name>" followed by comma separated key
> +          value pairs containing the data of interest. Event names and their
> +          arguments should be consistent across the code base, i.e. two events
> +          called in different locations should have the same arguments.

and now they are not even in order of their log level. That confuses people.

> +
> +          For example:
> +
> +          l_notice("event: mycondition, arg1: value1, arg2: value2, ...");

Please no semantics for the freeform text. If you want that, then better build some proper iwd_log functionality that does that.

Regards

Marcel


  reply	other threads:[~2024-02-14 19:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 19:37 [RFC 0/5] Using l_notice for low level IWD state information James Prestwood
2024-02-14 19:37 ` [RFC 1/5] main: add runtime flag for setting the logger James Prestwood
2024-02-14 19:37 ` [RFC 2/5] station: use l_notice for station_debug_event, allow arguments James Prestwood
2024-02-14 19:46   ` Marcel Holtmann
2024-02-14 20:02     ` James Prestwood
2024-02-14 20:11       ` Marcel Holtmann
2024-02-14 19:37 ` [RFC 3/5] station: add additional station_debug_event's James Prestwood
2024-02-14 19:37 ` [RFC 4/5] netdev: add notice events for connection timeouts James Prestwood
2024-02-14 19:37 ` [RFC 5/5] doc: document use of l_log APIs James Prestwood
2024-02-14 19:49   ` Marcel Holtmann [this message]
2024-02-14 19:55     ` James Prestwood
2024-02-14 20:12       ` Marcel Holtmann

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=1DB84D8A-74F6-43EC-9E27-A477FD343F0E@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.com \
    /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