Skip to content

util: use severity levels#5497

Merged
AdSchellevis merged 2 commits intoopnsense:masterfrom
kulikov-a:util_syslog_prio
Jan 23, 2022
Merged

util: use severity levels#5497
AdSchellevis merged 2 commits intoopnsense:masterfrom
kulikov-a:util_syslog_prio

Conversation

@kulikov-a
Copy link
Copy Markdown
Member

Hi!
I hope I didn't miss anything and now we can take advantage of using severity levels?
starting with GUI authentication logging )
Thanks!

@AdSchellevis AdSchellevis self-assigned this Jan 23, 2022
@AdSchellevis
Copy link
Copy Markdown
Member

@kulikov-a thanks, it was on my list somewhere to look into this. There are probably more spots to inspect at some point, but this is a good starting point.

@AdSchellevis AdSchellevis merged commit 9225fc3 into opnsense:master Jan 23, 2022
@fichtner
Copy link
Copy Markdown
Member

fichtner commented Jan 23, 2022 via email

@kulikov-a
Copy link
Copy Markdown
Member Author

kulikov-a commented Jan 23, 2022

@AdSchellevis Thanks!
@fichtner @AdSchellevis

I don’t think a „log_error“ function should be able to change priority

Can we discuss options then? Maybe it would be more correct to add an additional function (say log_msg()) with the severity arg, then go through all the log_error calls and change it where appropriate?
or just rename function and calls everywhere?

@AdSchellevis
Copy link
Copy Markdown
Member

I agree the naming is indeed a bit unfortunate, but I also don't want to add functions for every level (growing legacy base with limited value). @kulikov-a your suggestion to wrap the current functionality in log_msg() and keep log_error() functionally equal sounds reasonable to me.

@kulikov-a
Copy link
Copy Markdown
Member Author

@AdSchellevis Great! (actually, i even started with this approach, but then I decided that the less code the better) )
will you revert pr commits or should i start from the current point?

@fichtner
Copy link
Copy Markdown
Member

Yes, generic log message function is better is all I’m saying.

@AdSchellevis
Copy link
Copy Markdown
Member

@AdSchellevis Great! (actually, i even started with this approach, but then I decided that the less code the better) )
will you revert pr commits or should i start from the current point?

Just stack the change on top, no need to revert the previous code

@kulikov-a kulikov-a deleted the util_syslog_prio branch January 23, 2022 17:22
AdSchellevis pushed a commit that referenced this pull request Jan 24, 2022
* extend log_error to support levels
* mark auth messages as notice
fichtner pushed a commit that referenced this pull request Feb 14, 2022
* change default severity level
* mark auth messages as notice
* add a log_msg() function

(cherry picked from commit 9225fc3)
(cherry picked from commit 279de63)
(cherry picked from commit 1293d53)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants