How to get the current set LOG_MASK in Python's syslog module?

c.buhtz at posteo.jp c.buhtz at posteo.jp
Thu Sep 22 09:28:57 EDT 2022


X-Post: https://stackoverflow.com/q/73814924/4865723

Hello,

I'm aware that there is a `logging` package that is more _modern_ then 
[`syslog`](https://docs.python.org/3/library/syslog.html). But I have 
old code here to deal with that does use `syslog`. So that question is 
specific to `syslog` and not to `logging`.

I would like to get the current `LOG_MASK`, which is kind of a logging 
level. According to the docu it seems that `syslog` doesn't have a 
mechanism for that.

Does someone has an idea?

The docu also tells me that `syslog` does let pass all messages by 
default.
My point is I do manipulate via `syslog.setlogmask()` the current log 
leve. At the end I would like to set it back to its previous value.

Kind


More information about the Python-list mailing list