Skip to contentSkip to conversation

log: add l_notice

PATCH Applied James Prestwood 3 participants 9 messages Feb 13, 2024 – Feb 14, 2024

lore
Share & tools
lore
#0 lore raw

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
index 72dbed3..7ddf663 100644
@@ -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
#1 lore raw

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
index 72dbed3..7ddf663 100644

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

#2 lore raw

Hi Marcel,

Quoted 6 lines
Quoted 4 lines

#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?

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

#3 lore raw

Hi Denis,

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

#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?

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

#4 lore raw

Hi Marcel,

Quoted 11 lines · Marcel Holtmann

Hi Denis,

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

#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?

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.

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

#5 lore raw

Hi Denis,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

#define L_LOG_WARNING 4
+#define L_LOG_NOTICE 5
#define L_LOG_INFO 6
#define L_LOG_DEBUG 7

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_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.

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.

fine, then lets get a section into the coding style document.

Regards

Marcel

#6 lore raw

James,

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

#7 lore raw
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

#8 lore raw

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_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.

Awesome. Sounds good.

Regards,
-Denis