It provides ability to include severity of the message INTO the message. journalctl is then able to work with those severities and displays it in different colors. It would also allow to send selected priorities to different destination by configuration at rsyslog or similar. I think we want that, especially as we do not target non Unix systems in our project.
https://docs.python.org/3.12/library/logging.html offers multiplatform way to implement logs. But I doubt we will need that anytime soon. But we are losing details available to log system itself. Unless there is obivous way to configure logging module to actually use syslog, I think we should switch. We have no simple way to differentiate important messages in logs, which even dnsmasq can do by using syslog interface.
Compare these:
import syslog
syslog.syslog(syslog.LOG_ERR, 'error')
syslog.syslog(syslog.LOG_WARNING, 'warning')
syslog.syslog(syslog.LOG_INFO, 'info')
syslog.syslog(syslog.LOG_DEBUG, 'debug')
# now look at journalctl -xe
It makes it clear which one is more important. That is feature we want.
It provides ability to include severity of the message INTO the message. journalctl is then able to work with those severities and displays it in different colors. It would also allow to send selected priorities to different destination by configuration at rsyslog or similar. I think we want that, especially as we do not target non Unix systems in our project.
Compare these:
It makes it clear which one is more important. That is feature we want.