From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 4/7] iwd: add iwd_notice for special event/state type of logging
Date: Thu, 22 Feb 2024 07:24:48 -0800 [thread overview]
Message-ID: <20240222152451.1541682-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com>
iwd_notice is being added so modules can communicate internal
state or event information via the NOTICE log level. This log
level will be reserved in IWD for only these type of messages.
The iwd_notice macro aims to help enforce some formatting
requirements for these type of log messages. The messages
should be one or more comma-separated "key: value" pairs starting
with "event: <name>" and followed by any additional info that
pertains to that event.
iwd_notice only enforces the initial event key/value format and
additional arguments are left to the caller to be formatted
correctly.
---
src/iwd.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/iwd.h b/src/iwd.h
index 1be20df3..a8e2c5db 100644
--- a/src/iwd.h
+++ b/src/iwd.h
@@ -42,3 +42,17 @@ const char *iwd_get_iface_blacklist(void);
const char *iwd_get_phy_whitelist(void);
const char *iwd_get_phy_blacklist(void);
bool iwd_is_developer_mode(void);
+
+#define IWD_NOTICE_STATE "state"
+#define IWD_NOTICE_CONNECT_INFO "connect-info"
+#define IWD_NOTICE_ROAM_INFO "roam-info"
+#define IWD_NOTICE_DISCONNECT_INFO "disconnect-info"
+#define IWD_NOTICE_FT_ROAM_FAILED "ft-roam-failed"
+#define IWD_NOTICE_CONNECT_FAILED "connect-failed"
+#define IWD_NOTICE_AUTH_TIMEOUT "authentication-timeout"
+#define IWD_NOTICE_ASSOC_TIMEOUT "association-timeout"
+#define IWD_NOTICE_CONNECT_TIMEOUT "connect-timeout"
+#define IWD_NOTICE_ROAM_SCAN "roam-scan"
+
+#define iwd_notice(event, ...) \
+ l_notice("event: " event ", " __VA_ARGS__)
--
2.34.1
next prev parent reply other threads:[~2024-02-22 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 15:24 [PATCH 1/7] auto-t: fix failed_roam_test to pass when run on its own James Prestwood
2024-02-22 15:24 ` [PATCH 2/7] auto-t: timestamp log files in test-runner James Prestwood
2024-02-22 15:24 ` [PATCH 3/7] main: add runtime flag for setting the logger James Prestwood
2024-02-22 16:16 ` Denis Kenzior
2024-02-22 15:24 ` James Prestwood [this message]
2024-02-22 15:24 ` [PATCH 5/7] doc: document use of l_log APIs James Prestwood
2024-02-22 15:24 ` [PATCH 6/7] station: use iwd_notice for state/event information James Prestwood
2024-02-22 15:24 ` [PATCH 7/7] netdev: add notice events for connection timeouts James Prestwood
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=20240222152451.1541682-4-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@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