From: James Prestwood <prestwoj@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: iwd@lists.linux.dev
Subject: Re: [RFC 5/5] doc: document use of l_log APIs
Date: Wed, 14 Feb 2024 11:55:38 -0800 [thread overview]
Message-ID: <d9a38d47-e188-4e24-a397-515c0f525e8d@gmail.com> (raw)
In-Reply-To: <1DB84D8A-74F6-43EC-9E27-A477FD343F0E@holtmann.org>
Hi Marcel,
On 2/14/24 11:49 AM, Marcel Holtmann wrote:
> 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.
You mean just the order they appear in this document or using l_notice
for this purpose in general?
>
>> +
>> + 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.
The intent was to use l_notice only for this purpose so I felt
describing the specific semantics was appropriate. I can remove the
example but since the intended use is very specific and has some syntax
requirements I think describing those here is needed.
>
> Regards
>
> Marcel
>
next prev parent reply other threads:[~2024-02-14 19:55 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
2024-02-14 19:55 ` James Prestwood [this message]
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=d9a38d47-e188-4e24-a397-515c0f525e8d@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
--cc=marcel@holtmann.org \
/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