log: add l_notice
PATCH 1/1 log: add l_notice
Adds the ability to use a notice (5) log level.
--- ell/log.h | 2 ++ 1 file changed, 2 insertions(+)
ell/log.h +2 -0
@@ -17,6 +17,7 @@ extern "C" {#define L_LOG_ERR 3#define L_LOG_WARNING 4 +#define L_LOG_NOTICE 5#define L_LOG_INFO 6#define L_LOG_DEBUG 7
@@ -84,6 +85,7 @@ void l_debug_disable(void);#define l_error (format, ...) l_log(L_LOG_ERR, format, ##__VA_ARGS__)#define l_warn (format, ...) l_log(L_LOG_WARNING, format, ##__VA_ARGS__) +#define l_notice (format, ...) l_log(L_LOG_NOTICE, format, ##__VA_ARGS__)#define l_info (format, ...) l_log(L_LOG_INFO, format, ##__VA_ARGS__)#define l_debug (format, ...) L_DEBUG_SYMBOL(__debug_desc, format, ##__VA_ARGS__)
Signature · 1 line
2.34.1
Hi James,
Quoted 10 lines
Adds the ability to use a notice (5) log level.
---ell/log.h| 2 ++1 file changed, 2 insertions(+)ell/log.h +0
-0
ell/log.h extern "C" { · line 22
Quoted 6 lines
ell/log.h +1
-0@@ -17,6 +17,7 @@ extern "C" {#define L_LOG_ERR 3#define L_LOG_WARNING 4 +#define L_LOG_NOTICE 5#define L_LOG_INFO 6#define L_LOG_DEBUG 7
for what? What is the difference to just use l_info?
Regards
Marcel
Hi Marcel,
Quoted 6 lines
Quoted 4 lines
#define
L_LOG_WARNING4
+#defineL_LOG_NOTICE5
#defineL_LOG_INFO6
#defineL_LOG_DEBUG7for what? What is the difference to just use
l_info?
Per conversation on Slack, James wants to categorize certain messages for easier searching. Since NOTICE level exists, I suggested it would fit the usecase.
Regards,
-Denis
Hi Denis,
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
#define
L_LOG_WARNING4
+#defineL_LOG_NOTICE5
#defineL_LOG_INFO6
#defineL_LOG_DEBUG7for what? What is the difference to just use
l_info?Per conversation on Slack, James wants to categorize certain messages for easier searching. Since NOTICE level exists, I suggested it would fit the usecase.
I never really liked having many different levels. That was the reason I left l_notice out initially. I see no real benefit of it except us discussing "is this suppose to be l_info and l_notice" and in the end it will be just random.
So if you tell me / convince me when to use l_notice of l_info or use l_warn instead of l_notice, then we can talk.
Regards
Marcel
Hi Marcel,
Quoted 11 lines · Marcel Holtmann
Hi Denis,
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
#define
L_LOG_WARNING4
+#defineL_LOG_NOTICE5
#defineL_LOG_INFO6
#defineL_LOG_DEBUG7for what? What is the difference to just use
l_info?Per conversation on Slack, James wants to categorize certain messages for easier searching. Since NOTICE level exists, I suggested it would fit the usecase.
I never really liked having many different levels. That was the reason I left
l_noticeout initially. I see no real benefit of it except us discussing "is this suppose to bel_infoandl_notice" and in the end it will be just random.
There will always be some of that. Each project will have to calibrate individually, but I don't see a problem exposing this inside ell.
In iwd we use l_info for purely informational messages, like hardware capabilities. Most users won't care. l_notice would be used for things like roaming decision logic and other messages that do not warrant a l_warn / l_error. I think it is a nice in-between actually, particularly on non-user facing systems.
Regards,
-Denis
Hi Denis,
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
#define
L_LOG_WARNING4
+#defineL_LOG_NOTICE5
#defineL_LOG_INFO6
#defineL_LOG_DEBUG7
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
for what? What is the difference to just use
l_info?Per conversation on Slack, James wants to categorize certain messages for easier searching. Since NOTICE level exists, I suggested it would fit the usecase.
I never really liked having many different levels. That was the reason I left
l_noticeout initially. I see no real benefit of it except us discussing "is this suppose to bel_infoandl_notice" and in the end it will be just random.There will always be some of that. Each project will have to calibrate individually, but I don't see a problem exposing this inside ell.
In iwd we use
l_infofor purely informational messages, like hardware capabilities. Most users won't care.l_noticewould be used for things like roaming decision logic and other messages that do not warrant al_warn/l_error. I think it is a nice in-between actually, particularly on non-user facing systems.
fine, then lets get a section into the coding style document.
Regards
Marcel
Denis Kenzior
AppliedJames,
Quoted 2 lines
fine, then lets get a section into the coding style document.
Can you come up with something?
I've applied this patch, thanks.
Regards,
-Denis
Quoted 6 lines · Denis Kenzior
James,
Quoted 2 lines
fine, then lets get a section into the coding style document.
Can you come up with something?
Yep sure, but are you talking about IWD's or ELL's coding style document? l_log isn't used in ELL so I'm not sure its relevant there, and any external project using l_log could really do whatever they want with it.
For IWD yes, I planned on adding a coding style section along with my patches using l_notice as its going to be reserved for very specific use-cases and have some basic syntax requirements for tooling to parse.
Thanks,
James
Quoted 5 lines
I've applied this patch, thanks.
Regards,
-Denis
Hi James,
Quoted 10 lines · James Prestwood
Quoted 6 lines · Denis Kenzior
James,
Quoted 2 lines
fine, then lets get a section into the coding style document.
Can you come up with something?
Yep sure, but are you talking about IWD's or ELL's coding style document?
l_log
iwd
Quoted 3 lines
isn't used in ELL so I'm not sure its relevant there, and any external project using
l_logcould really do whatever they want with it.For IWD yes, I planned on adding a coding style section along with my patches using
l_noticeas its going to be reserved for very specific use-cases and have some basic syntax requirements for tooling to parse.
Awesome. Sounds good.
Regards,
-Denis